i have a file named as new.bat.
start /MIN 1.bat
my main file (new.bat) file is getting deleted and cmd process exit, leaving behind 1.bat which i want to delete.
i know del "%~f0" & exit
with this command self batch file is deleted, but wrong batch file is deleted
here are my below files
New.bat
echo echo 1 >>1.bat
echo del "%~f0" & exit >>1.bat
start /MIN 1.bat
pl Help
Try either:
Echo Echo 1 >>1.bat
Echo Del "%%~f0" ^& Exit >>1.bat
Start /MIN 1.bat
Or:
( Echo Echo 1
Echo Del "%%~f0" ^& Exit
)>1.bat
Start /MIN 1.bat