@echo off&setlocal enabledelayedexpansion

set fd=%1

for /f %%j in ('dir /b %fd%\*.tar.gz') do (
	SET a=%%~nj
	SET b=%%j
	
	7-Zip\7z.exe -bd x %fd%\%%j -o%fd%\ -y
	7-Zip\7z.exe x %fd%\!a! -o%fd%\ -y
	
	del %fd%\!a!
)
