兴国资源网 Design By www.nnzcdc.com
This short script uses WMI to display the same information than in the tool "tasklist", but dumping the result on the console. It can dump remote tasks running on another computer,
这个简短的脚本使用wmi显示与工具“tasklist”中相同的信息,但只有在命令行下输出结果。它也可以在另一台计算机上查看远程任务,
文件名:tasklist.vbs
要求:无
作者:Jean-Luc Antoine
提交日期:2005年7月14日
类别:4K
核心代码
Option explicit If right(Ucase(WScript.FullName),11)="WSCRIPT.EXE" Then wscript.echo "You should run this script from the command line (cmd)" & vbCrLf & "cscript " & wscript.ScriptFullName WScript.Quit End If dim strComputer,objWMIService,colProcesses,objProcess,ProcessTime,strCreationDate,user,Domain,strOwner,h,m,s,chaine strComputer = "." Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colProcesses = objWMIService.ExecQuery ("Select * from Win32_Process") ' where Name='IEXPLORE.EXE' Chaine="Process |Creation Date Time |Handles|Threads|Owner |Priority|MemoryUsage|MaxMemUsage|MemRequired|MaxMemRequi| Swap| Max Swap|CPU time|PID |PFaults|Path" & vbCrLf For Each objProcess in colProcesses If objProcess.GetOwner ( User, Domain ) = 0 Then strOwner= Domain & "\" & User Else strOwner="Unknown" End If ProcessTime=(CSng(objProcess.KernelModeTime) + CSng(objProcess.UserModeTime)) / 10000000 h=right("0" & fix(ProcessTime/60/60),2) ProcessTime=ProcessTime-h*60*60 m=right("0" & fix(ProcessTime/60),2) s=Right("0" & round(ProcessTime-m*60),2) strCreationDate=Mid(objProcess.CreationDate,7,2) & "/" & Mid(objProcess.CreationDate,5,2) & "/" & Left(objProcess.CreationDate,4) & " " & Mid(objProcess.CreationDate,9,2) & ":" & Mid(objProcess.CreationDate,11,2) & ":" & Mid(objProcess.CreationDate,13,2) If strCreationDate="// ::" Then strCreationDate=Space(19) Chaine=Chaine & Left(objProcess.Name & space(8),12) & "|" _ & strCreationDate & "|" & Right(Space(6) & objProcess.HandleCount,7) & "|" _ & Right(Space(6) & objProcess.ThreadCount,7) & "|" _ & Left(strOwner & space(14),19) & "|" _ & Left(objProcess.Priority & Space(7),8) & "|" _ & Right(Space(10) & objProcess.PageFileUsage ,11) & "|" _ & Right(Space(10) & objProcess.PeakPageFileUsage ,11) & "|" _ & Right(Space(8) & objProcess.WorkingSetSize ,11) & "|" _ & Right(Space(8) & objProcess.PeakWorkingSetSize ,11) & "|" _ & Right(Space(10) & objProcess.VirtualSize ,11) & "|" _ & Right(Space(10) & objProcess.PeakVirtualSize ,11) & "|" _ & h & ":" & m & ":" & s & "|" _ & Left(objProcess.ProcessID & space(3),4) & "|" _ & Right(Space(6) & objProcess.PageFaults ,7) & "|" & objProcess.ExecutablePath Chaine=Chaine & vbCrLf Next wscript.echo chaine
代码运行方法,将上面的代码为tasklist.vbs
在cmd下 cscript tasklist.vbs 即可,也可以在cmd下 cscript tasklist.vbs >list.txt直接将结果保存为list.txt查看也比较容易
好了,代码到此结束
兴国资源网 Design By www.nnzcdc.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
兴国资源网 Design By www.nnzcdc.com
暂无评论...
更新日志
2024年05月01日
2024年05月01日
- 张学友《爱你多一些精选》宝丽金88极品音色[WAV+CUE][520M]
- 古典发烧-帕格尼尼二十四首随想曲-RICCI【WAV+CUE】
- 群星.2015-金牌监听天碟-国语篇(ADMS限量版)2CD【金牌大风】【WAV+CUE】
- 群星《当打之年HQ》头版限量编号[低速原抓WAV+CUE]
- 韩雪.2004-飘雪【新索】【WAV+CUE】
- 万妮达.2021-云泥之别【摩登天空】【FLAC分轨】
- 李嘉格.2018-奇妙地【梦想当然】【FLAC分轨】
- [PTC5186225]花痴系列-《斯特拉文斯基春之祭》迈克尔·蒂尔森·托马斯
- [ABC唱片]-《西电之声—大电影》[德国版HD]【WAV+CUE】
- 新民樂演奏《蘭閨寂寂上海管弦楽團伴奏》[WAV+CUE]
- 《半吨兄弟单曲合集100首》[WAV分轨][3.1G]
- 群星《经典粤语老歌》原音母版1:1直刻 [WAV+CUE][671M]
- 《张宇4CD合集》[WAV分轨][1.5G]
- 柳岩.2009-岩色EP【光线】【WAV+CUE】
- 戚薇.2012-如果爱忘了(EP)【海蝶】【WAV+CUE】