Process Exit Code When Process is Killed Forcibly

2019-01-15 19:08发布

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

2条回答
forever°为你锁心
2楼-- · 2019-01-15 19:20

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

查看更多
Emotional °昔
3楼-- · 2019-01-15 19:36

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.

查看更多
登录 后发表回答