zipping bulk files-800 Dbs

  • Hi,

    I need to zip around 800 DB's which have been detached some time back,

    I have written a program to zip automaticaly,but it tells an error message that winzip i snot recoganised format,Ther version of winzip installed is WinZip 9.0 SR-1

    I am attaching the script ,please modify the script and help me

    -----------------------

    DECLARE DB_archive CURSOR FOR

    SELECT db_name from DB_List1203

    OPEN DB_archive

    FETCH NEXT FROM DB_archive INTO @db_name

    IF @@FETCH_STATUS <> 0

    PRINT 'All DBS Zipped'

    WHILE @@FETCH_STATUS = 0

    BEGIN

    set @txt = 'WinZip -a V:\Data_1\'+@db_name +'.zip V:\Data_1\'+@db_name+'.mdf'

    Exec master..xp_cmdshell @txt

    FETCH NEXT FROM DB_archive INTO @db_name

    END

    CLOSE DB_archive

    DEALLOCATE DB_archive

    -----------------------

    Error message-'WinZip' is not recognized as an internal or external command,

    operable program or batch file.

    NULL

    ------------------------

  • I used WZUNZIP plug-in to WINZIP to unzip files in a batch. You have to install this plug-in from WinZIP website. It says requires version 10. I am running the plug-in with version 9, but I may have the previous version of it.

    http://www.winzip.com/downcl.htm

    and click "WinZip Command Line"

    Regards,Yelena Varsha

  • Have you tried supplying the path to the location of your winzip executable in your built up command? You can't assume that your WinZip software folder is incuded the default paths of where Windows will look for executables.

    Harv

  • Any reason not to do this from the command line?

    You can use this to see what it does:

    for %%i IN ( V:\Data_1\*.MDF) DO echo "C:\Program Files\WinZip\WinZip32.exe" -a %%~di%%~pi%%~ni.zip %%i

    and this to run it:

    for %%i IN ( V:\Data_1\*.MDF) DO "C:\Program Files\WinZip\WinZip32.exe" -a %%~di%%~pi%%~ni.zip %%i

    I know that the %%~pi and such is unusual, but here's (from help for) what they do:

    %~dI - expands %I to a drive letter only

    %~pI - expands %I to a path only

    %~nI - expands %I to a file name only

    Jim

  • Or yah,

    the error message that is in the original post refers to WINZIP while Jim's script says "WinZip32.exe"

    Regards,Yelena Varsha

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply