简体   繁体   English

taskkill实用程序的退出代码是什么?

[英]What are exit codes from the taskkill utility?

In my MSI installer custom-action handler (done with C++) I cannot obtain the SE_DEBUG_NAME privilege to be able to open and terminate a process, thus I have to resort to doing it with the taskkill utility as such: 在我的MSI安装程序自定义操作处理程序(使用C ++完成)中,我无法获得SE_DEBUG_NAME权限以便能够打开和终止进程,因此我不得不使用taskkill实用程序来执行此操作:

taskkill /f /pid 1230

What I need to know are the return codes from the taskkill to be able to see if the process was terminated or not and the reasons why it may not have been. 我需要知道的是来自taskkill的返回代码,以便能够查看进程是否终止以及可能没有的原因。

I was able to obtain the following experimentally on my Windows 8 machine: 我能够在Windows 8机器上通过实验获得以下内容:

0 = success
1 = access denied
128 = no such process

Is there an official documentation for these? 这些是官方文件吗?

Official error code documentation is at: 官方错误代码文档位于:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx http://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx

Unfortunately this covers ALL windows error codes, which may well be shared between applications. 不幸的是,这涵盖了所有Windows错误代码,这些代码可能在应用程序之间共享

However the two you mentioned above are on there. 但是你上面提到的两个都在那里。 For example, 128 is listed as 'There are no child processes to wait for.' 例如,128被列为“没有要等待的子进程”。

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

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