Batch File Fails

  • Thread starter Thread starter harryj
  • Start date Start date
H

harryj

Can anyone explain why the following batch file fails in
WinXP but runs fine in Win98?
backup.bat
: dele files on floppy
echo Y|del a:\*.*

: zip files
pkzip.exe -& a:\tp.zip *.dbf *.fpt *.cdx *.sys


The "delete files" command runs OK. The "pkzip" command
does not perform the PARAMETERS statement.
It stops with PKZIP (just as if the command was PKZIP only)
and displays the PKZIP Help screen.
The PKZIP.EXE file and the BATCH file and the FILES to be
zipped are all in the same directory.
 
Perhaps (I'll let you check) the ampersand causes the problem. In NT's command shell ampersand means run the command before the ampersand then the command after the ampersand. && means run the second command if the first command succeeds.

Type command shell overview in Help. It will tell you to use ^& in your command line.
 
Back
Top