Welcome to Scripting Forums Sign in | Join | Help
in Search

Trouble with Winzip CLI and parentheses in the file name

Last post 09-10-2008, 9:53 PM by AbqBill. 2 replies.
Sort Posts: Previous Next
  •  08-15-2008, 8:06 PM 29990

    Trouble with Winzip CLI and parentheses in the file name

    I cannot zip a file at the command line with a left paren in the file name. (

    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.

    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:%%(=_%

    Can anyone suggest a way to get the replacement command to work as I want it to?

  •  08-18-2008, 1:53 AM 29991 in reply to 29990

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

    Do you have some more info on the command you use, I have no problems at all archiving files wil either a single left "(", a single right ")"  or both parnes in a filename

    I am using WinZip 11.2 with the V2.3 commandline addon.

    Cheers, Hans

    PS. This is how I tested it.

    C:\Documents and Settings\User>dir /b *.pst
    Copy of archive2007(1).pst
    Copy of archive2007(1_.pst
    Copy of archive2007_1).pst

    C:\Documents and Settings\User>"c:\Program Files\WinZip\wzzip" pst.zip "C:\Documents and Settings\User\Copy of archive2007(1).pst"
    WinZip(R) Command Line Support Add-On Version 2.3 (Build 8094)

    updating Copy of archive2007(1).pst
    updating Zip file pst.zip

    C:\Documents and Settings\User>"c:\Program Files\WinZip\wzzip" pst.zip "C:\Documents and Settings\User\Copy of archive2007(1_.pst"
    WinZip(R) Command Line Support Add-On Version 2.3 (Build 8094)

    updating Copy of archive2007(1_.pst
    updating Zip file pst.zip

    C:\Documents and Settings\User>"c:\Program Files\WinZip\wzzip" pst.zip "C:\Documents and Settings\User\Copy of archive2007_1).pst"
    WinZip(R) Command Line Support Add-On Version 2.3 (Build 8094)

    updating Copy of archive2007_1).pst
    updating Zip file pst.zip

    C:\Documents and Settings\User>

    Also tried this without the full path spec, and also no problem there

  •  09-10-2008, 9:53 PM 30052 in reply to 29990

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

    Hi thelotus2006,

    ( and ) are special characters in Cmd.exe, so you must escape them with the ^ symbol; e.g.

    zip -9X mydocs^(1^).zip c:\data\*.doc

    ...or something similar.

    Bill

View as RSS news feed in XML
SPONSORED LINKS FEATURED LINKS

Free Download –VS 2008 TrainingExperts Ken Getz & Robert Green plus labs, code, courseware Maximize speed, performance and reliablity of your PCs and servers—automatically!Speed Up Your PC! Try Diskeeper 2008 with InvisiTasking Free Now! Register for SolarWinds VM MonitorGet X-Ray Vision into Your ESX Servers with SolarWinds FREE VM Monitor GoGrid Offers FREE Trial for Windows Cloud ServersDeploy Windows Server 2003 and 2008 with free load balancing through GoGrid’s award winning web-based GUI – all in less than 5 minutes Order Your SQL Fundamentals CD Today! Learn how to use SQL Server, understand Office integration techniques and dive into the essentials of SQL Express and Visual Basic with this free SQL Fundamentals CD. How healthy is your Exchange Server? Find out Now!Automatic Exchange Server Maintenance helps prevent disasters and improves performance. Download a FREE Exchange Server analysis tool. You've Deployed SharePoint...Now What?This one-day free online conference delivers the technical knowledge needed to kick MOSS up a notch. In one information-packed day, independent SharePoint experts will present practical, real-world information and provide take-away, ready-to-use solutions Ease Your Scripting Pains with the Flexibility of PowerShell!Paul Robichaux equips you with PowerShell basics in 3 introductory lessons, each followed by live Q&A—all on your own computer! Register today! What Would You Do If You Ran Microsoft?ITTV's 2008 inaugural video contest, "If I Ran Microsoft..." is your chance to tell it like it is. Be goofy or be serious, but don"t miss this chance to have fun, win prizes, and go viral in a major way. Maximize Your SharePoint InvestmentThis web seminar discusses how true bi-directional replication of SharePoint content from one server to another enables branch offices to maintain access to current SharePoint content. Rock Your Knowledge, and Compete with Friends and Colleagues!Are you the Web Application Performance Guru in your office? It's time to have fun! Download now to access the crossword puzzle. Challenge yourself and complete this fun activity!

 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing