You get the error because the batch process is looking for the next line to execute, but the file is gone.
I believe all you need to do is explictly EXIT after deleting the file. It is important that the EXIT be parsed and executed in the same block as the DEL command.
del "%~f0"&exit
or
(
del "%~f0"
exit
)