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?
The taskkill command allows a user running any version of Microsoft Windows from XP on to "kill" a task from a Windows command line by PID (process id) or image name. This command is similar to end tasking a program in Windows.
Taskkill.exe is a type of an executable file developed by Microsoft for Windows Operating System. This has the function to end one or more task or processes and you shouldn't be worried about it.
If you want to explore what's available, type taskkill /? then hit Enter. This will reveal some powerful options for using Task Kill. For example, if you want to kill a group of programs, type: TASKKILL /PID 1230 /PID 1241 /PID 1253 /T.
Taskkill.exe is a legitimate process file popularly known as taskkill.exe. It belongs to Windows Operating System developed by Microsoft Corporation. It is located in C:\Windows\System32 by default.
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.'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With