How to make a batch file delete itself?

前端 未结 9 963
遇见更好的自我
遇见更好的自我 2020-11-28 06:07

Is it possible to make a batch file delete itself?

I have tried to make it execute another file to delete it but this did not work.

Does any one know how I cou

9条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-28 06:16

    del "%~f0"
    

    will work, but there's an error message if you call it from a previously open console (can be ignored however).

提交回复
热议问题