At some point in my script, I\'d like the bat script to delete itself. This requires that the script know its name and then to use that name to delete itself. Is this possib
For me it was important, that I have no errorLevel 1 after I exited the batch file. I found an suitable and easy answer this way: DeleteMyself.cmd:
START CMD /C DEL DeleteMyself.cmd
Test batch if DeleteMyself.cmd is returning errorLevel 0. TestDeleteMyself.cmd:
call DeleteMyself.cmd
echo Errorlevel: %errorLevel%