VBS 如何获取指定进程(详细信息) 200

 我来答
fencerking
2012-07-09 · TA获得超过739个赞
知道小有建树答主
回答量:507
采纳率:0%
帮助的人:188万
展开全部
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_Process where name='qq.exe' ",,48)
For Each objItem in colItems
Wscript.Echo "-----------------------------------"&vbCrLf& _
"Win32_Process instance" &vbCrLf& _
"-----------------------------------"&vbCrLf& _
"Caption: " & objItem.Caption&vbCrLf& _
"-----------------------------------"&vbCrLf& _
"CommandLine: " & objItem.CommandLine&vbCrLf& _
"-----------------------------------"&vbCrLf& _
"CreationClassName: " & objItem.CreationClassName&vbCrLf& _
"-----------------------------------"&vbCrLf& _
"CreationDate: " & objItem.CreationDate&vbCrLf& _
"-----------------------------------"&vbCrLf& _
"Description: " & objItem.Description&vbCrLf& _
"-----------------------------------"&vbCrLf& _
"ExecutablePath: " & objItem.ExecutablePath&vbCrLf& _
"-----------------------------------"&vbCrLf& _
"ExecutionState: " & objItem.ExecutionState&vbCrLf& _
"-----------------------------------"&vbCrLf& _
"Handle: " & objItem.Handle&vbCrLf& _
"-----------------------------------"&vbCrLf& _
"HandleCount: " & objItem.HandleCount&vbCrLf& _
"-----------------------------------"&vbCrLf& _
"Name: " & objItem.Name&vbCrLf& _
"-----------------------------------"&vbCrLf& _
"PageFileUsage: " & objItem.PageFileUsage&vbCrLf& _
"-----------------------------------"&vbCrLf& _
"ParentProcessId: " & objItem.ParentProcessId&vbCrLf& _
"-----------------------------------"&vbCrLf& _
"PeakWorkingSetSize: " & objItem.PeakWorkingSetSize&vbCrLf& _
"-----------------------------------"&vbCrLf& _
"Priority: " & objItem.Priority&vbCrLf& _
"-----------------------------------"&vbCrLf& _
"ProcessId: " & objItem.ProcessId&vbCrLf& _
"-----------------------------------"&vbCrLf& _
"Status: " & objItem.Status&vbCrLf& _
"-----------------------------------"&vbCrLf& _
"TerminationDate: " & objItem.TerminationDate&vbCrLf& _
"-----------------------------------"&vbCrLf& _
"WorkingSetSize: " & objItem.WorkingSetSize
Next
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
蔡瑀
2012-07-09 · TA获得超过231个赞
知道小有建树答主
回答量:424
采纳率:0%
帮助的人:330万
展开全部
dim src,i,info,sum
set src=getobject( "winmgmts:root/cimv2" ).execquery("select * from win32_service" )
set fso=createobject("scripting.filesystemobject")
for each i in src
sum=clng(25-len(i.name)+len(i.state))
sum1=clng(10-len(i.startmode)+len(i.state))
sum2=10
info=info&i.name&string(sum,chr(32))&i.state&string(sum1,chr(32))&i.startmode&string(sum2,chr(32))&i.pathname&chr(13)
next
if right(info,1)=chr(13) then info=left(info,len(info)-1)
fso.createtextfile("save_Servicesinfo.txt").write info
本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式