简体   繁体   中英

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:

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?

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.'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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