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.
"C:\Program Files\7-zip\7z.exe" a file1.zip "O:\server2\map files\BC\BC.d*"-0 "C:\Program Files\7-zip\7z.exe" a file2.zip "O:\server2\map files\BC\ON.d*"-0 "C:\Program Files\7-zip\7z.exe" a file3.zip "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 file1.zip 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\file1.zip" 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\file1.zip" 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.