简体   繁体   English

强制终止进程时的进程退出代码

[英]Process Exit Code When Process is Killed Forcibly

When we kill a process in Windows with Task Manager End Process command, will the process still return an exit code? 当我们使用任务管理器结束进程命令在Windows中终止进程时,进程是否仍会返回退出代码? And if so, what exit code it returns? 如果是这样,它返回什么退出代码? Thanks 谢谢

In general, a process is terminated using TerminateProcess . 通常,使用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. 对于任务管理器,退出代码设置为1,但我不知道它是否记录在任何地方。

是的,它将返回非零返回码,它将包含在%ERRORLEVEL%变量中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM