Process Exit Code When Process is Killed Forcibly

雨燕双飞 提交于 2019-11-26 23:35:18

问题


When we kill a process in Windows with Task Manager End Process command, will the process still return an exit code? And if so, what exit code it returns? Thanks


回答1:


In general, a process is terminated using TerminateProcess. The exit code is passed as a parameter to this method.

In the case of the task manager, the exit code is set to 1, but I don't know if it's documented anywhere.




回答2:


Yes, it will return non-zero return code which will be wrapped in %ERRORLEVEL% variable.



来源:https://stackoverflow.com/questions/4344923/process-exit-code-when-process-is-killed-forcibly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!