Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have read through some suggestions but I am just not technical enough to get this I think.

I am a CAD designer and each file has 5 files associated with it. I have 3 sets of 5 files, and each set needs to go into its own zip file, placed on a separate server.

For example:

"C:\Program Files\7-zip\7z.exe"  a "O:\server2\map files\BC\BC.d*"-0
"C:\Program Files\7-zip\7z.exe"  a "O:\server2\map files\BC\ON.d*"-0
"C:\Program Files\7-zip\7z.exe"  a "O:\server2\map files\BC\AB.d*"-0

and I am in directory "S:\server\map files\provinces" (for example).

These lines run within an existing batch file and by the time it reaches the 3 lines above, it's in the S: directory sample above. So it's looking on my pc for the 7-zip program, creating 3 zip file names which it does, but places those zip files on a separate server which it doesn't and the first zip file also includes all the other 10 files, the second zip file the same plus the first zip file, and the third the same with the other two zip files making me think the code isn't recognizing the part after where I am trying to tell it what files to include and where to place the zip files.

Ultimately, I want to either have the system create a new zip file if the old one was deleted, or copy the new files into the existing zip and overwrite any older files, and for these zip files to be placed in a separate location which is where we share our files with other personnel from within our company. The S: drive is for all originals, and O: is for sharing.

Is there a list of all switching options with many different samples?


Okay! I think I tried every single possible (possible not meaning every scenario worked), way to order the above code and I final have it.

"c:\program files\7-zip\7z.exe" u "O:\server2\map files\BC\" bc.d*,


"c:\program files\7-zip\7z.exe" is the location of the program itself (often referred to as the 'verb' or action word of the sentence - or the act of compression,

u versus using a either creates an archive (in my case a .zip file since I didn't specify to the system that I wanted it to create a compressed folder of another format), if one doesn't exist or only updates/compresses new versions of the files to an existing archive if an archive already exists.

"O:\server2\map files\BC\" is the location where the zip file will be created or updated and the name to give the archive or name of existing archive,

finally followed by the names of the files (bc.d*) you want to include in the archive. There are 5 files that start with bc with different extensions and the extensions also start with d. DBG, DBN, DBI, DBQ, and DBA. using the * or asterisk, tells the system to copy all files named bc with extensions staring with d. The reasoning for this, is our CADD files can sometimes have other supporting files but their extensions would not begin with d and they are also not important enough to want to archive.

Great little program that just solved a lifetime issue we have been having. Thanks 7-zip.

share|improve this question
Do these commands work if you type them directly into a Command Prompt? How about in a batch file with nothing else? Can you show us a listing of your BC directory? Why are you putting the –0 outside the quotation marks? – Scott Sep 24 '12 at 20:47
If you download the 7-Zip Command Line Version there's a 7-zip.chm help file included you can read. Also there's some good examples in this. – martineau Sep 24 '12 at 21:50
Scott, the -0 outside the quotation marks is more me being a newb. Tried putting them in and out and on either end. Martineau, I can't find a download link for the 7Za that you referred to. I actually found and browsed that page prior to posting this question but Z-zip download pages talks of the new version being an all-in-one solution. I'll try the command prompt and in a separate batch file and return my results. Thanks for both your input. – Larry Sep 25 '12 at 15:37
Okay! Now I am cooking with grease as they say. ie. bacon grease is hot and spurting all over the place. :) – Larry Sep 25 '12 at 16:56

You must log in to answer this question.

Browse other questions tagged .