by Herbert Kleebauer <klee@[EMAIL PROTECTED]
>
Jun 8, 2006 at 09:47 PM
JoAnne wrote:
> Is it possible to write a line of code in a .bat file, one that would
> be in the LAST line of the file, and would cause the .bat file to
> DELETE itself as a "last step?"
How about using the delete command?
In Win2k/XP:
del %~f0
and in Win9x (works only if the batch is in the current
directory or invoked with the full file name but not if
the batch is in a %PATH% directory):
if exist %0.bat del %0.bat
if exist %0 del %0
NOTE: IF the batch is in a %PATH% directory and is invoked
only with the name (without the .bat) and there is a file
with the same name but without an extension in the current
directory, than this file is deleted!