Board logo

标题: [文本处理] 批处理命令taskkill 错误提示,无法正常结束进程 [打印本页]

作者: yahong1001    时间: 2014-10-7 19:50     标题: 批处理命令taskkill 错误提示,无法正常结束进程

碰到一个机器,bat文件执行无效

是不是系统哪里服务没有启动,

path路径设置问题

求大神解答
作者: Batcher    时间: 2014-10-7 20:12

C:\Windows\System32\taskkill.exe
这个文件存在吗?
从其它电脑复制这个文件覆盖到这台电脑可以吗?
作者: CrLf    时间: 2014-10-7 20:16

试试 tskill 和 wmic
作者: yahong1001    时间: 2014-10-7 23:07

回复 2# Batcher
文件存在,拷贝一个也是不行
作者: CrLf    时间: 2014-10-8 00:09

http://blogs.technet.com/b/smsan ... nstall-sdk-mof.aspx
大意貌似是 wmi 命名空间错误引发的
着重看这几段:
Cause: This can occur if the EventTrace class is missing from the root\wmi namespace on the client.

Resolution: To resolve this issue, copy mom_tracing.mof from Program Files\System Center Operations Manager 2007 on a working machine to the same directory on the affected machine. Then on the affected machine run:

mofcomp mom_tracing.mof


This will most likely lead to an error looking for the EventTrace class in WMI which the mom_tracing.mof is dependent upon. This can be verified by running wbemtest and connecting to Root\WMI, then doing a recursive Enum of the classes and looking for EventTrace as a class.

就是叫你去正常的电脑上拷一个 mom_tracing.mof,然后用 mofcomp 加载它
-------------------------------------------------------------------------
第一次知道,原来 taskkill 还跟 wmi 有关系,涨姿势了,但为毛我电脑上没有 这个 mom_tracing.mof
作者: Batcher    时间: 2014-10-8 08:15

回复 5# CrLf


    安装了SCOM才会有这个文件
作者: Linuxer    时间: 2014-10-8 09:22

还真是没遇到过这样的提示,,命令书写没有错,,我这64位win7,sp1使用正常。。
作者: yahong1001    时间: 2014-10-8 18:47

试试 tskill 和 wmic
CrLf 发表于 2014-10-7 20:16


使用tskill命令,提示找不到进程PID 有进程在也是提示找不到
wmic  这个就不会用了
作者: Batcher    时间: 2014-10-8 20:26

回复 8# yahong1001


wmic process where "name='wscript.exe'" call terminate




欢迎光临 批处理之家 (http://bathome.net./) Powered by Discuz! 7.2