What are exit codes from the taskkill utility?

我的未来我决定 提交于 2019-12-19 16:54:34

问题


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:

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.

I was able to obtain the following experimentally on my Windows 8 machine:

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

Is there an official documentation for these?


回答1:


Official error code documentation is at:

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.

However the two you mentioned above are on there. For example, 128 is listed as 'There are no child processes to wait for.'



来源:https://stackoverflow.com/questions/18682681/what-are-exit-codes-from-the-taskkill-utility

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