Computing.Net > Forums > Programming > Zip all files in folder using 7z

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Zip all files in folder using 7z

Reply to Message Icon

Name: cypster
Date: August 31, 2009 at 15:40:30 Pacific
OS: Windows Vista
CPU/Ram: Dual Core/4GB
Product: Hewlett-packard / Iq505
Subcategory: Batch
Comment:

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
cls
exit

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?



Sponsored Link
Ads by Google

Response Number 1
Name: ricardo647
Date: August 31, 2009 at 18:24:44 Pacific
Reply:

"%programfiles%"\7-Zip\7z.exe a All.zip c:\test\*

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

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


0

Response Number 2
Name: cypster
Date: August 31, 2009 at 19:04:52 Pacific
Reply:

errmmm that looks way tooo easy... If it works I will have to eat my chair... Let me go test it...


0

Response Number 3
Name: cypster
Date: August 31, 2009 at 19:11:49 Pacific
Reply:

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.


0

Response Number 4
Name: ricardo647
Date: September 1, 2009 at 01:49:59 Pacific
Reply:

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).


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Zip all files in folder using 7z

Process all files in a folder www.computing.net/answers/programming/process-all-files-in-a-folder-/16681.html

Batch program to process all files in folder www.computing.net/answers/programming/batch-program-to-process-all-files-in-folder/19798.html

batchRenaming files in Folder tree www.computing.net/answers/programming/batchrenaming-files-in-folder-tree-/18621.html