@echo off

set fd=%1

setlocal enabledelayedexpansion

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 %%j
	::del %fd%\%a%
)
