求这段代码的详解解析。。谁解释出来我叫他哥

set bag=getobject("winmgmts:\\.\root\cimv2") set pipe=bag.execquery("select * from win32_process where name='qq.exe'") For Each id In pipe id.terminate

额。看上去和VB语言风格有点像
set bag=getobject("winmgmts:\\.\root\cimv2") //首先获取对象,这里我想应该是一种结构吧
set pipe=bag.execquery("select * from win32_process where name='qq.exe'") //执行查询并将结果赋予pipe,这里的pipe应该是继承了cimv2的结构
For Each id In pipe //循环pipe(它应该是数组之类的),并将item付给变量id
id.terminate //id下面存在terminate属性,但因为代码不完整,不知道想干什么。。。
温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-09-20
set bag=getobject("winmgmts:\\.\root\cimv2")
获取遍历进程列表
set pipe=bag.execquery("select * from win32_process where name='qq.exe'")

在进程列表里查找QQ.exe 这个进程
For Each id In pipe id.terminate

遍历这个进程,中断和这个进程有关的资源

以上纯属猜测,如有雷同,纯属巧合