问题
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