I'm googling now, but I haven't found an answer so far.
I have a couple folders with 700+ files in them. I want to compress each file into it's own achive without doing each one by hand. Does anyone know the best way to do this?
-
-
The command line, 7z.exe, and a for loop can do that in a single line:
Note that this assumes unique filenames minus extensions (i.e. foo.mpg and foo.txt will both end up in foo.7z), if that's not the case you'll probably need to put this in a batch file with some additional magic to check/modify the archive file names.Code:for /r "C:\target_directory" %i in (*.*) do "%ProgramFiles%\7-Zip\7z.exe" a -t7z "C:\output_directory\%~ni" "%i"
-
Nope, they're all identical file names. Thanks!
7zip + multiple files at once
Discussion in 'Windows OS and Software' started by JohnnyFlash, Nov 12, 2009.