Your batch file will add two files to the archive, one named
vipul.xls and one named
files.
I'm assuming that
files doesn't need to be there; in the syntax examples,
files is used to show where to put the file name you want to work with, it's not actually part of the command.
So that line should be this:
Code:
"C:\Program Files\WinZip\WINZIP32.EXE" -min -a -ex "C:\Documents and Settings\vipul\Desktop\vipul.zip" vipul.xls
If the file name changes, you would have to modify the batch file if you want to run the batch file directly. You
can set it up to allow you to drag and drop the file onto the batch file (or a shortcut to it), or specify the file name on the command line.
The following will work in any user account. I've also set it up so you can specify the Valuations folder path in the 2nd line. This will let you easily change it to a different drive, or for next year. It will also create the Valuations and Briefcase folders if needed.
Code:
@Echo Off
Set _Valuations=E:\Valuations\2009
If Not [%1]==[] Goto _ChkIt
If EXIST "%Temp%\Tmp.txt" Del /F "%Temp%\Tmp.txt"
:_Error
>>"%Temp%\Tmp.txt" Echo.You must specify a file name, either on the command line, or
>>"%Temp%\Tmp.txt" Echo.by dropping the file you wish moved to the Briefcase onto the icon.
>>"%Temp%\Tmp.txt" Echo.Close this window to exit.
Start /W "" Notepad "%Temp%\Tmp.txt"
Del /F "%Temp%\Tmp.txt"
Goto :EOF
:_ChkIt
If EXIST "%~1" Goto _ZipIt
>"%Temp%\Tmp.txt" Echo.Unable to locate "%~1"
Goto _Error
:_ZipIt
Set _ZipName=%~n1.zip
If NOT EXIST "%UserProfile%\Desktop\My Briefcase" MD "%UserProfile%\Desktop\My Briefcase"
If NOT EXIST "%_Valuations%" MD "%_Valuations%"
"%ProgramFiles%\Utilities\WinZip\WINZIP32.EXE" -min -a -ex "%UserProfile%\Desktop\%_ZipName%" "%~1"
Copy "%UserProfile%\Desktop\%_ZipName%" "%UserProfile%\Desktop\My Briefcase"
Copy "%UserProfile%\Desktop\%_ZipName%" "%_Valuations%"
HTH
Jerry