Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

question with pwzip

Status
Not open for further replies.

Volkmaniac

Technical User
Mar 19, 2003
104
US
I'm having trouble using the pwzip command with the following script. I replaced the "shortpath" command that was in the original and replaced it with findfirst. It's creating the actual zip file but it's not finding and zipping the files I tell it to. In other words, the backup.zip file is empty.



proc main
string sPWZipPath, sCmdLine, sZipName, sTargetPath, sTargetFile, sSourcePath, sSourceMask, sTemp
integer iRunTaskID

sZipName = "PWZIP.EXE"
sPWZipPath = $PWTASKPATH ;Set up the paths
sTargetPath = "S:\Client Services\LETTERS\" ;Path to save ZIP file to
sTargetFile = "backup" ;Name to give to ZIP file, do not add .ZIP extension!
sSourcePath = $ASPECTPATH


sSourceMask = "*txt" ;Filter to use when searching for source files

findfirst sSourcePath sTemp
addfilename sPWZipPath sZipName ;Build execute statement
strfmt sCmdLine "%s %s%s`x01 %s\%s `x01 -c" sPWZipPath sTargetPath sTargetFile, sTemp, sSourceMask

run sCmdLine iRunTaskID ;Run PWZIP
pause 5
while taskexists iRunTaskID ;Wait for PWZIP to finish
yield
endwhile
endproc
 
PWZip doesn't like spaces in the path (which sTargetPath at least does have), so that is likely why the files are not being added. You'll want to use the shortpath command on sTargetPath and sSourcePath so that PWZip doesn't have any spaces to deal with.

aspect@aspectscripting.com
 
knob,

You must be a master programmer. Your recommendation worked and now I'm able to zip anything.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top