diff --git a/7ztools/7z batch to add one file to one archiv.bat b/7ztools/7z batch to add one file to one archiv.bat index 61fa0f9..809cbe4 100644 --- a/7ztools/7z batch to add one file to one archiv.bat +++ b/7ztools/7z batch to add one file to one archiv.bat @@ -6,6 +6,7 @@ SET ZIPEXE=.\7z-bin\x86\7z.exe if %PROCESSOR_ARCHITECTURE%==AMD64 SET ZIPEXE=.\7z-bin\x64\7z.exe if %PROCESSOR_ARCHITECTURE%==ARM SET ZIPEXE=.\7z-bin\x86\7z.exe if %PROCESSOR_ARCHITECTURE%==ARM64 SET ZIPEXE=.\7z-bin\arm64\7z.exe +SET LINE=================================================== REM ARCHTP: zip, 7z, xz, gz SET ARCHTP=zip @@ -15,7 +16,27 @@ SET MX=9 REM FINDTP: Filetype (exe, and more) SET FINDTP=exe -(for %%a IN ("*.%FINDTP%") DO "%ZIPEXE%" u -t%ARCHTP% -mx=%MX% "%%a".%ARCHTP% "%%a" ) +for %%a IN ("*.%FINDTP%") DO ( + echo %LINE% + echo add "%%a".%ARCHTP% + echo %LINE% + "%ZIPEXE%" u -t%ARCHTP% -mx=%MX% "%%a".%ARCHTP% "%%a" + if errorlevel 1 goto error + + echo %LINE% + echo check "%%a".%ARCHTP% + echo %LINE% + "%ZIPEXE%" t "%%a".%ARCHTP% + + if errorlevel 1 goto error +) + +:exits timeout 10 -exit \ No newline at end of file +exit /b %errorlevel% + +:error +echo An error has occurred. Errorcode: %errorlevel% +pause +goto exits \ No newline at end of file diff --git a/7ztools/7z batch to add one folder to one archiv.bat b/7ztools/7z batch to add one folder to one archiv.bat index a130d2d..67ef67b 100644 --- a/7ztools/7z batch to add one folder to one archiv.bat +++ b/7ztools/7z batch to add one folder to one archiv.bat @@ -6,13 +6,38 @@ SET ZIPEXE=.\7z-bin\x86\7z.exe if %PROCESSOR_ARCHITECTURE%==AMD64 SET ZIPEXE=.\7z-bin\x64\7z.exe if %PROCESSOR_ARCHITECTURE%==ARM SET ZIPEXE=.\7z-bin\x86\7z.exe if %PROCESSOR_ARCHITECTURE%==ARM64 SET ZIPEXE=.\7z-bin\arm64\7z.exe +SET LINE=================================================== REM ARCHTP: zip, 7z SET ARCHTP=zip REM MX: 0 - 9 SET MX=9 -for /F "tokens=*" %%A IN ('dir /b ".\"') do ( cd "%%A" && "%ZIPEXE%" u -t%ARCHTP% -mx=%MX% ..\"%%A".%ARCHTP% .\ && cd .. ) +for /F "tokens=*" %%A IN ('dir /b /ad ".\"') do ( + pushd "%%A" + echo %LINE% + echo add "%%A".%ARCHTP% + echo %LINE% + "%ZIPEXE%" u -t%ARCHTP% -mx=%MX% ..\"%%A".%ARCHTP% .\ + + if errorlevel 1 goto error + + echo %LINE% + echo check "%%A".%ARCHTP% + echo %LINE% + "%ZIPEXE%" t ..\"%%A".%ARCHTP% + + if errorlevel 1 goto error + + popd +) + +:exits timeout 10 -exit \ No newline at end of file +exit /b %errorlevel% + +:error +echo An error has occurred. Errorcode: %errorlevel% +pause +goto exits