Skip to content

Commit

Permalink
Update 7z tools
Browse files Browse the repository at this point in the history
  • Loading branch information
LizenzFass78851 committed Aug 14, 2024
1 parent 8b6fdb4 commit b0fb8b4
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 4 deletions.
25 changes: 23 additions & 2 deletions 7ztools/7z batch to add one file to one archiv.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
exit /b %errorlevel%

:error
echo An error has occurred. Errorcode: %errorlevel%
pause
goto exits
29 changes: 27 additions & 2 deletions 7ztools/7z batch to add one folder to one archiv.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
exit /b %errorlevel%

:error
echo An error has occurred. Errorcode: %errorlevel%
pause
goto exits

0 comments on commit b0fb8b4

Please sign in to comment.