Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > Re: Trouble with Winzip CLI and parentheses in the zip file name

Reply
Thread Tools Display Modes

Re: Trouble with Winzip CLI and parentheses in the zip file name

 
 
Al Dunbar
Guest
Posts: n/a

 
      08-16-2008

"Mike" <> wrote in message
news:afc27084-99a4-45d9-951d-...
>I cannot zip a file at the command line with a left paren in the file
> name. (
>
> I've use these commands to change the parens to underscores but only
> the right one gets replaced, using the same command:
> set PST_TO_ZIP_ZIPFILENAME=%PST_TO_ZIP=_%
> set PST_TO_ZIP_ZIPFILENAME=%PST_TO_ZIP=_%
>
> I have also tried these to no avail:
> set PST_TO_ZIP_ZIPFILENAME=%PST_TO_ZIP:^(=_%
> set PST_TO_ZIP_ZIPFILENAME=%PST_TO_ZIP:"("=_%
> set PST_TO_ZIP_ZIPFILENAME=%PST_TO_ZIP:%(=_%
> set PST_TO_ZIP_ZIPFILENAME=%PST_TO_ZIP:%%(=_%
>
> Here is the output of the Winzip command:
>
> Attempting to compress "Copy of archive2007(1).pst"
>
> PST Zipfile name: Copy of archive2007(1_.pst
> Press any key to continue . . .
> WinZip(R) Command Line Support Add-On Version 2.3 (Build 8094)
> Copyright (c) WinZip International LLC 1991-2008 - All Rights Reserved
>
>
> Error: No files were found for this operation - Nothing to do. (C:
> \Users\USERBEINGBACKEDUP\Local Settings\Application Data\Microsoft
> \Outlook\Copy of archive2007(1_.pst.zip)
> Winzip Errorlevel: 12
> .pst.zip was unexpected at this time.
> C:\WINDOWS>
>
> and when you get a "was unexpected at this time." error your script
> dies. grr.
> Can anyone suggest a way to get the replacement command to work as I
> want it to?


I have run into variations of the same problem and never found a simple
solution. For a workaround, I usually would up taking a completely different
approach. Here are a few possibilities:

- write the possibly offending filename into a text file and use a text
replacement utility to change the parens to, say, the equivalent square
brackets. GSAR.EXE, for example, allows you to specify the strings to
operate on using hex equivalents, thereby avoiding the need to try to pass a
parenthesis as a literal parameter.

- write a vbscript file that accepts a filename, uses the REPLACE function
to make the necessary changes.

/Al


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
installed winzip, vista edition, but IE7 literally attacked winzip Aluv4Fun Internet Explorer 2 04-09-2008 06:22 PM
winzip file Angelica907 Windows Vista Mail 0 06-22-2007 02:01 AM
Re: Winzip 11 is out Aaron Kelley Windows 64 Bit 1 11-16-2006 09:05 AM
Security message when opening a WinZip file Chris Internet Explorer 4 11-03-2006 01:38 PM
WinZip 10.0 Maratonmannen Windows 64 Bit 7 11-22-2005 04:02 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59