Erase an executable file (.exe) after finishing without knowing its location?

1

The bat file has been converted into an executable. The del "%~f0" command does not work! Will it be necessary to finish running the executable first taskkill /f "nome_do_executável.exe" and then delete it?

Question:
- How to locate the file in windows and delete it?

Thanks in advance @SachaDee for %~dpnx0 !

start "nome_da_aplicação" cmd.exe /k "mode 90,5 & del /s /q %~dpnx0 >nul 2>&1 & exit"
    
asked by anonymous 03.04.2018 / 15:30

1 answer

1

You can use this at the end of the bat script:

start cmd /k  "del %~dpnx0"
    
03.04.2018 / 17:02