set wd=f:\temp set od=f:\snes :-------- @echo off if not exist "%~dp0\7za.exe" ( echo 7za.exe missing. Place it next to this script and start again. pause exit ) for /f "tokens=*" %%i in ( 'dir /b /s /a-d "%~1\*.7z"' ) do ( "%~dp0\7za.exe" e "%%i" -o"%wd%\tempext\" if not exist "%od%\%%~pi\" md "%od%\%%~pi\" "%~dp0\7za.exe" a -t7z -mx0 -md=6m "%wd%\%%~ni.7z" "%wd%\tempext\*" move "%wd%\%%~ni.7z" "%od%\%%~pi\" rd /q /s "%wd%\tempext\" )