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!

"" marks

Status
Not open for further replies.

Matta25

Technical User
Jan 6, 2004
82
US
Hello, I have a script that needs to unzip a password protected file. lets say the password is test^3. the ^ is causing the trouble. if i enter the password as "test^3" it work file. the problem is the procomm script already has " ". How do you enter double "" ""?
If i type the pkzip25 -ext -pass="test^3" $filespec in a dos windows it works fine. procomm doesn't like the double "" "" in this strfmt line.
here is the script:
strfmt DosCmd "pkzip25 -ext -pass="test^3" %s" $filespec
dos DosCmd minimized TaskId
while taskexists TaskId
yield
endwhile
 
You can use `" (that's a backtick in front of the double quoe in case it isn't clear) to represent a double quote inside of a string variable. So in your case, the line should look like this:

strfmt DosCmd "pkzip25 -ext -pass=`"test^3`" %s" $filespec


aspect@aspectscripting.com
 
Do you have a copy of this entire script? I've been looking for a way to unzip password protected files for a long time.
 
I have 2 files called file1.zip and File2.zip that have a password of ABCD^3. This will look for the first file called file1.zip then extract the zip file using the password ABCD^3. It will then delete the password protected zip file and then loop around again to do file2.zip. (you will need PKZip25 installed on your pc to do this)
Hope this helps.

proc main
; variable declaration
integer TaskId
string DosCmd, Pass

While FindFirst "D:\downloads\file*.zip"
Pass = "ABCD^3"
strfmt DosCmd "pkzip25 -ext -pass=%c%s%c %s" 34 Pass 34 $filespec
dos DosCmd minimized TaskId
while taskexists TaskId
yield
endwhile
delfile $filespec
EndWhile

endproc
 
strfmt DosCmd "pkzip25 -ext -pass=%c%s%c %s" 34 Pass 34 $filespec

this line uses pkzip25 to extract (-ext) the file. Then use the password "ABCD^3".
(The -pass=%c%s%c $s means - the 34=" Pass=ABCD^3 34=" so procomm put plug the password as "ABCD^3")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top