TerminateProcess 不适用于经过验证的进程 ID
我正在开发应该杀死具有给定名称的进程的应用程序。 我使用的操作系统是 Windows 7。问题是,对于任务管理器中列出的具有非空白用户名字段的所有进程,它都可以正常工作。但是,当进程的用户名为空时,即使任务管理器也无法杀死该进程。
谁能告诉我为什么有些进程没有用户名。就我而言,它是 csrss.exe winlogon.exe ,不幸的是我想杀死一个旧应用程序。我检查的所有其他进程都有正确的用户名。
有什么方法可以将用户名添加到现有流程中吗?
任何人都可以向我推荐比杀死应用程序更好的解决方案吗? 终止进程()?
I am working on application that is supposed to kill a process with a given name.
Operating system I use is windows 7. The thing is that for all processes listed in task manager with a non-blank USER NAME field it works fine. However when a process has an empty username cannot be killed even by task manager.
Can anyone tell me why some processes has no user name. In my case it is csrss.exe winlogon.exe and unfortunately an old application I want to have killed. All other processes I examined has a proper username.
Is there any way to add a username to existing process ?
Can anybody recomend me better solution killing for killing application than
terminateProcess() ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这些进程无法终止,因为您没有这样做的权限。您必须使用提升的权限来执行您的应用程序才能使其正常工作。没有其他办法。
Those process cannot be terminated because you have no priviledges to do so. You would have to execute your application with elevated priviledges for it to work. There is no other way.