tags:

views:

28

answers:

1

Hi there,

I tried to find the answer to this in several places and failed, so here it goes:

I have a directory, say, "Project" which has a lot of sub directories and files. I want to make a batch program which just zips this Project directory. But also, I want to skip just a few particular files and just one folder.

I figured that I have to iterate all items and add them to zip one by one, and I dont know how to do this.. or is there a better way to do this?

I tried this:

@ECHO OFF
start c:\"Program Files (x86)"\WinRAR\WinRAR.exe %CUR-DATE%.ZIP Project\*.*
pause

just to see if it works.. Winrar is installed in that location.. for starters I thought I would see if zipping all files work.. but it dint work, no error, nothing, it just runs and quits.

Any Idea where I should start?

Many thanks!

+1  A: 

You can use the [email protected] switch.

The manual for this command line interface switch is here.

HTH!

Just curious... Why don't you use the (") to enclose the whole Winrar Path+Filname spec instead of just the "Program Files (x86)" part?

belisarius
oh this is awesome! thanks! and I enclosed only program file part because there was a space in it, and command line was through path not found error.. after I put it in double quotes it stopped showing that error, but it dint work either, so now i will try to put the whole thing in quotes and see if it does, thanks so much! :)
iamserious
this is great, thanks! just finished coding the horrendous thing, it works like a beast!!
iamserious
Glad to hear that. Good luck!
belisarius