taskkill实用程序的退出代码是什么? [英] What are exit codes from the taskkill utility?

查看:115
本文介绍了taskkill实用程序的退出代码是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的MSI安装程序自定义操作处理程序(使用C ++完成)中,我无法获得SE_DEBUG_NAME特权才能打开和终止进程,因此,我必须诉诸于taskkill实用程序,例如:/p>

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

我需要知道的是taskkill的返回码,以便能够查看该进程是否终止以及为何未终止该进程的原因.

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.

我能够在Windows 8计算机上通过实验获得以下信息:

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

不幸的是,它涵盖了所有Windows错误代码,这些错误代码很可能在应用程序之间共享.

Unfortunately this covers ALL windows error codes, which may well be shared between applications.

但是您上面提到的两个都在那里.例如,128列为没有等待的子进程."

However the two you mentioned above are on there. For example, 128 is listed as 'There are no child processes to wait for.'

这篇关于taskkill实用程序的退出代码是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆