None of the existing answers provides a clean way for the batch file to delete itself and exit without a visible error message.
Just inclusion del "%~f0"deletes the script, but also leads to the ugly "Batch file cannot be found." error message.
If OK for the script to close the parent CMD process (console window), then the following works fine without an error message:
del "%~f0"&exit
, , script CMD- .
1. , , . EXIT /B, , , , , script , STARTed .
start /b "" cmd /c del "%~f0"&exit /b
2. , , , CALL stderr nul.
>"%~f0.bat" echo del "%~f0" "%~f0.bat"
2>nul "%~f0.bat"