DEL失败的解决方法没有设置errorlevel

时间:2017-08-07 13:55:07

标签: cmd

我很失望地看到

S:\!DJ DAP>del nofile || pause
Could Not Find S:\!DJ DAP\nofile
S:\!DJ DAP>

即。没有停顿。原因揭示:

S:\!DJ DAP>echo Exit Code is %errorlevel%
Exit Code is 0

最直接的解决方法是什么?

PS虽然官方DEL文档没有说错误设置应该设置为错误,这个

S:\!DJ DAP>del
The syntax of the command is incorrect.

S:\!DJ DAP>echo Exit Code is %errorlevel%
Exit Code is 1

这个https://ss64.com/nt/del.html表明应该这样做。没有拉伸是缺少目标文件而不是错误!

1 个答案:

答案 0 :(得分:1)

我没有足够的代表评论或关闭重复,但这与此问题完全相同:

https://stackoverflow.com/a/33403497

相关问题