Skip to content

Instantly share code, notes, and snippets.

@jorgedison
Created July 16, 2019 16:17
Show Gist options
  • Save jorgedison/d13691ed093ed86a2683ea78924485b3 to your computer and use it in GitHub Desktop.
Save jorgedison/d13691ed093ed86a2683ea78924485b3 to your computer and use it in GitHub Desktop.
rem Batch compressing individual files (non recursive)
for %A in (*.png *.txt) do "G:\UTILITIES\7-Zip\7z.exe" a -t7z -m9=LZMA2 "%A.7z" "%A"
rem Batch compressing individual files (recursive)
for /R "L:\My\Folder\" %A in (*.txt *.doc) do "G:\UTILITIES\7-Zip\7z.exe" a -t7z -m9=LZMA2 "%A.7z" "%A"
rem Batch compressing all folders of the current directory
for /D %A in (*) do "G:\UTILITIES\7-Zip\7z.exe" a -t7z -m9=LZMA2 "%A.7z" "%A"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment