Yeah, I know, you're right. I manually massaged it to work. Hey, what can I say dude... I love your program too much and try to use it for unintended purposes.
Registered: 2000-11-01
Posts: 22
Loc: Brisbane, QLD, Australia
NTDOC,
I think I've found the problem. Its not the way that the variables are passed to shell. Its wzzip, I just did a cmd line test of it and it failed showing that you can not have -v combined with other options.
wzzip -a -ex -rp "c:\files\thisdir.zip" "c:\files\exdir -v exdir\*.*"
Well now I have to find another way around. Maybe a rename script.
Here is the full commandline used in a DOS Window: (I don't have WZZIP.EXE in path so I use full path)
C:\PROGRA~1\WinZip\WZZIP.EXE -a -ex -rp "c:\files\thisdir.zip" "c:\files\exdir -v exdir\*.*"
Here is the listing of the files and directories I have.
quote:C:\FILES\- V -ex -v C:\FILES\- V -ex -v\egensock.cpp C:\FILES\- V -ex -v\fgensock.cpp C:\FILES\- V -ex -v\ggensock.cpp C:\FILES\-v C:\FILES\-v\Rebel C:\FILES\-v\Rebel\Contents.txt C:\FILES\-v\Rebel\Readme.txt C:\FILES\-v\Rebel\Temp - V -v C:\FILES\-v\Rebel\Temp - V -v\NSDSESS.TXT C:\FILES\-v\moose.jpg C:\FILES\Clients C:\FILES\Clients\files.txt C:\FILES\Compaq C:\FILES\Compaq\NextGen C:\FILES\Compaq\NextGen\IBM C:\FILES\Compaq\NextGen\IBM\- v - ex -r -p -P -ee C:\FILES\Compaq\NextGen\IBM\- v - ex -r -p -P -ee\-v C:\FILES\Compaq\NextGen\IBM\- v - ex -r -p -P -ee\Copy of -v C:\FILES\Compaq\NextGen\IBM\- v - ex -r -p -P -ee\Copy of sdk45y.txt C:\FILES\Compaq\NextGen\IBM\- v - ex -r -p -P -ee\sdk45y.txt C:\FILES\Compaq\NextGen\IBM\Bakegensock.cpp C:\FILES\Compaq\NextGen\IBM\Bakfgensock.cpp C:\FILES\Compaq\NextGen\IBM\Bakggensock.cpp C:\FILES\Compaq\NextGen\egensock.cpp C:\FILES\Compaq\NextGen\fgensock.cpp C:\FILES\Compaq\NextGen\ggensock.cpp C:\FILES\Compaq\fort.txt C:\FILES\GENSOCK C:\FILES\GENSOCK\gensock.cpp C:\FILES\GENSOCK\gensock.h C:\FILES\HP C:\FILES\HP\-ex C:\FILES\HP\-ex\snsock.cp C:\FILES\HP\Copy of leftck.cpp C:\FILES\HP\leftck.cpp C:\FILES\Testing -v C:\FILES\Testing -v\egensock.cpp C:\FILES\Testing -v\fgensock.cpp C:\FILES\Testing -v\ggensock.cpp C:\FILES\exdir -v exdir C:\FILES\exdir -v exdir\egensock.cpp C:\FILES\exdir -v exdir\fgensock.cpp C:\FILES\exdir -v exdir\ggensock.cpp C:\FILES\files.txt
It created a single zip file with all folders.
I use the -ee switch because is creates a smaller file then -ex that was the old highest compression switch, now it is -ee I also use -rP (Capital P) to get the full path of directories in the zip file as well.
I then modified the KiXtart file to use the new path (not the same path you listed before) and re-ran the code.
I got the same error. That is because the quotes were not sufficient to capture all of the information.
I modified the command line to this: (you don't need a space and - switch for each option it can be supplied with a single - followed by multiple options. shell 'C:\PROGRA~1\WinZip\WZZIP.EXE -eeorP "$archdir$filename.zip" "$basedir\$filename\*.*"'
This now produces the following files in the C:\ZIP folder: - V -ex -v.zip Clients.zip Compaq.zip exdir -v exdir.zip GENSOCK.zip HP.zip Testing -v.zip -v.zip
Each zip file contains all the files within its own folder and includes the FULL path.
Please retry the code EXACTLY as I've supplied and you should find it now zips up the files as expected.
Another flash in the pan? Come on back, the waters fine.
Why do we get so many people come by and ask a question, then they either don't check the answer or they get the answer and never come back?
KiXtart.org is a GREAT place with a lot of good people. Rod was saying that something like 17,000 people have downloaded Shawn's KiXforms DLL. That is a lot of people, a rather large SILENT Majority so it would seem.
Registered: 2000-11-01
Posts: 22
Loc: Brisbane, QLD, Australia
NTDOC,
I ran your code posted: posted 16. June 2003 09:36.
It functions with winzip9 beta - cmd line but in winzip8 cmd line, it will fail on file names with -v in them. (0004642 Rider-Bell Denise Marilyn -v Carison)
This is the code I ran, with the change for the winzip8 cmd line. -------------- break on $basedir="c:\files" $filename=dir("$basedir\*") $archdir="c:\zip\" WHILE ($filename <> "") AND (@error = 0) IF ($filename <> ".") AND ($filename <> "..") AND (GetFileAttr($basedir+"\"+$filename) & 16) shell 'C:\PROGRA~1\WinZip\WZZIP.EXE -a -ex -rp "$archdir$filename.zip" "$basedir\$filename\*.*"' ENDIF $filename=dir() LOOP EXIT 0 ------------
Tested on a WindowsXP WZ8+cmdline
I hope I can see it your way, then it may work. Thanks for your patience Phoe.
It was a pain in the butt, but I un-installed WinZip 9 and rebooted. Then I re-installed all Winzip 8.0 and command-line add-on v1.0
I can confirm that 8.0 DOES NOT work. Version 9.0 beta DOES WORK fine.
Not sure what you're really trying to do here though. There are plenty of applications and methods for backing up files or systems.
Using Winzip for this purpose is okay for a quicky, but not very robust. Why do you need separate zip files for each folder?
Why not upgrade to Winzip 9 beta? It is a free upgrade for registered users.
Maybe if you give us more details on what the FULL STORY is for the archiving purposes we can either script something better or recommend a better product.
In the same/similar category as Winzip, there is WinRaR too.