echo off echo %0 running... rem This version is to be used for dragging and dropping a source rem filename in Explorer, to create a .zip file of the same name. rem Alternatively, you can create a shortcut to this program, put rem the shortcut in the Windows\Sendto folder, then, run it by right rem clicking on a file name in Explorer, selecting Sendto, and then rem select the shortcut name you have selected. rem The command line version of this program is Zipmake.bat. Both versions rem require the use of the PKZip Commandline program, available at: rem http://www.pkware.com/ rem If you drag and drop the filename onto this program, %1 will rem contain the entire path, i.e. C:\Dir\Filename, which is why this version rem requires that the ren command be replaced with the Xcopy32 command. rem Xcopy32 retains the original long file name, but copy and xcopy don't. rem Also, I couldn't use PKZip's -move parameter, since I had to Xcopy rem temp.zip on top of the original file, to retain the long file name. rem Some ideas for this program came from Tom Lavedas' website, rem http://www.pressroom.com/~tglbatch/ (c) W. Baldwin, 3/2000. if '%1==' for %%v in (echo goto:ERROR) do %%v Required filename missing. %1\ cd %1\.. if exist temp.zip for %%v in (echo goto:ERROR) do %%v Temp.zip already exists pkzip25 -add -max temp.zip %1 if errorlevel 1 goto error echo F | xcopy32 %1 *.tmp echo F | xcopy32 temp.zip %1 rem ren %1 *.zip echo F | xcopy32 %1 *.zip echo F | xcopy32 *.tmp %1 for %%f in (temp.zip *.tmp) do del %%f goto done :ERROR echo An error has occurred. :DONE Echo Finished