Zip all files in folder using 7z

Hewlett-packard / Iq505
August 31, 2009 at 15:40:30
Specs: Windows Vista , Dual Core/4GB
Here I am again swimming in batch mud... I have the following script...

@echo off
for /R %%i in (*) do "C:\PortableApps\7-ZipPortable\App\7-Zip\7z.exe" a -t7z -mx=7 -ms=off "%%i.7z" "%%i"
goto end

I expected this script to zip All of the contents of the current folder into one big lump zip file... but instead it is zipping the batch file into a zip file and then climbing into the subdirectories and zipping the contents there into individual zip files one by one... eeekkk... I am starting to think that batch files really really don't like me... :( Any ideas out there?

See More: Zip all files in folder using 7z

Report •

August 31, 2009 at 18:24:44
"%programfiles%"\7-Zip\7z.exe a c:\test\*

This code worked with me.
"Test" has many files and subdiretories. All were zipped into

The code is too basic, but if it is more or less what you want you can complicate the thing.

Report •

August 31, 2009 at 19:04:52
errmmm that looks way tooo easy... If it works I will have to eat my chair... Let me go test it...

Report •

August 31, 2009 at 19:11:49
Did you know that chairs are rich in fiber... They are some of the most versatile foods that one could ever eat!.... Nibble nibble munch munch!! I can't believe it was really that easy... Oh dear... What will the batch files disgrace me with next. Thanks a caboodle ricardo647.

Report •

Related Solutions

September 1, 2009 at 01:49:59
Thats it, Cypster. I stopped smoking this days and today had also eaten two pies, two chairs, a juicy keyboard..
(and half a cigar in the corner).

Report •

Ask Question