Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 316
c00000fd Avatar asked Sep 08 '13 10:09

c00000fd


People also ask

How does taskkill work?

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.

What is taskkill EXE?

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.

How do you taskkill a team?

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.

Where is taskkill EXE located?

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.


1 Answers

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

like image 174
Overlord_Dave Avatar answered Sep 28 '22 08:09

Overlord_Dave