' ps.vbs ' Returns the status of the given processes. ' ----------------------------------------- Option Explicit 'On Error Resume Next ' Variables Dim objWMIService, objItem, colItems, argc, ps, i ' Get and hash process information Set objWMIService = GetObject ("winmgmts:\\.\root\cimv2") Set colItems = objWMIService.ExecQuery ("Select * from Win32_Process") Set ps = CreateObject("Scripting.Dictionary") For Each objItem in colItems if Not ps.Exists(objItem.Name) Then ps.Add objItem.Name, 1 End If Next ' Parse command line parameters and check each process argc = Wscript.Arguments.Count For i = 0 To argc - 1 Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine " " Wscript.StdOut.WriteLine " " If argc = 0 Or ps.Exists(Wscript.Arguments(i)) Then Wscript.StdOut.WriteLine " " Else Wscript.StdOut.WriteLine " " End If Wscript.StdOut.WriteLine "" Wscript.StdOut.flush Next