| 1. |
Solve : using wzzip in batch file? |
|
Answer» Hello there, first time posting here, in HOPES someone can help resolve my frustration... causes an error in the batch if i leave this What error? Did the wzzip program issue the error? The syntax you posted is correct. I was able to duplicate your Winzip code with no problems. well when I put the line in with he -a option it will give a message"cannot fine -a" that throws me because I was following the instructions from the help file and I STARTED to suspect that it was not actually appending the zip file, because the properties did not show that the file had been changed. I added a test txt file in the directory that was supposed to be zipped, and the test file was not listed... yea its driving me crazy, I had perused the help section that came with wzzip for a couple of days before posting here... thank you for your help! err, cannot find -aDOS usually takes arguments in the for /* not -* but if the documentations says so....I've tried short path names, long path names, quotes, no quotes and I cannot get your code to fail. The -a switch is the DEFAULT, so why not eliminate it? Code: [Select]"c:\program files\winzip\wzzip" c:\backup\ffbackup\ffbackup.zip *.* If you can, turn off echo in your batch file, run from the command prompt and post any output to the console. I'm having a hard time fixing something that is not broke. well maybe I misunderstand what the behavior of wzzip is supposed to do. perhaps this is a test grasshoppa basically it still seems my batch is only copying the existing zip file (residing in \c:\backup\ffbackup\), and not creating another one and copying that... that is ultimately what I am wanting to accomplish. I'm confused. Are you having problems with wzzip syntax or are you getting unexpected results. There is a difference. Quote basically it still seems my batch is only copyinarchiveg the existing zip file (residing in \c:\backup\ffbackup\), and not creating another one and copying that... That would DEPEND on the source files. The -a switch will add new files to the archive. Use the -f switch to replace files that are already part of the Zip file and are newer on disk. Use the -u switch to add to the archive any files that are not already in the Zip file, and replaces any files that have a more recent date on disk. Code: [Select]"c:\program files\winzip\wzzip" -u c:\backup\ffbackup\ffbackup.zip *.* for /f "tokens=1-5 delims=/ " %%d in ("%date%") do ( copy /y /v c:\backup\ffbackup\ffbackup.zip %%e-%%f-%%g.zip ) The above code produces two copies of the archive. One on c: and one in the current directory. Code: [Select]for /f "tokens=1-5 delims=/ " %%d in ("%date%") do ( "c:\program files\winzip\wzzip" -u %%e-%%f-%%g.zip *.* ) The above code simplifies the process, creating one zip file in the current directory. Note to Self: In the next lifetime, come back as a dentist. Great, I have briefly tested and think I see where you have made improvements. I will have to play with it a bit more, but you're giving me a push in the right direction. I was under the impression that I had to put the start line in the batch to launch the app. I hope I havent added any grey hairs, or shortened your life span any |
|