Connecting Tech Pros Worldwide Forums | Help | Site Map

Command Line Escape Characters (WinZip) Options

Newbie
 
Join Date: Mar 2008
Posts: 5
#1: Sep 25 '08
Hi

I have a zip file that is encrypted with a tricky password, which I
need to extract from a .bat file.


The password is: -33,33_(}33"33*33=33|33^%33


So I try this line in a .bat file:
"c:\program files\winzip\wzunzip.exe" -o -s-33,33_(}33"33*33=33|33^%33
MYZIP.zip C:\MYZIP\


This hits a problem because of the double-quote in the password.
"ERROR - missing closing quote on argument"


This also doesn't work:
-s"-33,33_(}33""33*33=33|33^%33"


I believe the ^ char is an escape character for DOS Command Line
arguments, but that doesn't work. I tried to simplify this by changing
the password temporarily to 33"33 and using the following arguments:
-s33^"33
-s"33^"33"


No luck. If I try this:
-s"33""33"


It DOES actually get passed, but it comes back with "Skipping xxxx -
the password is incorrect", even though if I use winzip through the
interface, it works.


Any ideas?

harshadd's Avatar
Familiar Sight
 
Join Date: Dec 2007
Posts: 177
#2: Nov 7 '08

re: Command Line Escape Characters (WinZip) Options


Hi guys I wonder no answers yet ???????
Yes, I mean it, its is very simple.
whatever your password is when you are passing it from a .bat file (Its a bad idea to save any passwords in open text) Any ways still if you want to use it like that, here is the way:

Save your password in a simple text file,for e.g say MyPASS, use any TEXT editor for that. MyPASS is a filename without any extension (optional).
Make sure you have your password typed in a single line and you have pressed ENTER key at the end of line containing your password to start a new line. But not typed any thing on 2nd line. Save this file in same directory (folder MS people says it) with your .BAT file. Your bat file should have similar line to call command line wzunzip.exe
"C:\Program Files\WinZip\wzunzip.exe" -o -s C:\test.zip c:\hnd < MyPASS
This will execute wzunzip.exe to open test.zip file extract it using password saved in MyPASS file into C:\HND directory.

This technique is called "Redirecting standard input" , While executing a command if DOS interpreter finds a need to take an input from user it stops executing and wait for an input to be entered by a user.
"Lessthan" < sign is used to redirect such inputs from a pre-saved file.


Warm Regards
Harshad Dandekar
Reply