Is there a list of known exit codes (errorlevel) for TaskKill.exe? Does this vary with the Windows version? I'm mostly concerned with Windows 7 and server 2008r2.
They probably correspond to standard Windows error codes. If you want to look up the verbose description, run NET HELPMSG nnnn, where nnnn is the exit code.
C:\>taskkill /im notepad.exe SUCCESS: Sent termination signal to the process "notepad.exe" with PID 12144. C:\>echo %errorlevel% 0 C:\>net helpmsg 0 The operation completed successfully.
All Win32 error codes are listed in the MSDN documentation: