Skip to content

Instantly share code, notes, and snippets.

@BenMcLean
Last active March 15, 2024 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BenMcLean/526b2e3c182e3a498203c9be69471790 to your computer and use it in GitHub Desktop.
Save BenMcLean/526b2e3c182e3a498203c9be69471790 to your computer and use it in GitHub Desktop.
7-zip batch
@ECHO OFF
cd %~dp0
for /R %%F in (*.3ds) do ( "c:\Program Files\7-Zip\7z.exe" a "%%F.7z" "%%F" & if not errorlevel 1 del "%%F" )
@PAUSE
@ECHO OFF
cd %~dp0
for /f "eol=: delims=" %%F in ('dir /b /a-d ^| findstr /vixc:"%~nx0"') do ( "c:\Program Files\7-Zip\7z.exe" a "%%F.7z" "%%F" & if not errorlevel 1 del "%%F" )
@PAUSE
@ECHO OFF
cd %~dp0
for /d %%X in (*) do ( "c:\Program Files\7-Zip\7z.exe" a "%%X.7z" "%%X\" & if not errorlevel 1 rd /s /q "%%X" )
@PAUSE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment