什么是taskkill.exe退出代码?

是否有已知的退出代码(errorlevel)为TaskKill.exe的列表? 这是否与Windows版本有所不同? 我最关心的是Windows 7和服务器2008r2。

如果您在PowerShell中编写脚本,为什么要对TASKKILL.EXE进行“脱壳”。 为什么不使用Stop-Process cmdlet? 然后,您可以完全控制任何exception处理,等等。

它们可能对应于标准的Windows错误代码。 如果要查找详细说明,请运行NET HELPMSG nnnn,其中nnnn是退出代码。

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. 

所有Win32错误代码都列在MSDN文档中:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx