An excerpt from next script could help (given all info although checking Caption
and CommandLine
could suffice). Derived from Scriptomatic utility.
' NameSpace: \root\CIMV2 Class : Win32_Process
' D:\VB_scripts_help\Scriptomatic
'
Option Explicit
On Error GoTo 0
Dim sRes, arrComputers, objWMIService, colItems, oItem, strComputer
sRes = Wscript.ScriptName
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
arrComputers = Array(".")
sRes = sRes & vbNewLine & "NameSpace: \root\CIMV2 Class : Win32_Process"
For Each strComputer In arrComputers
sRes = sRes & vbNewLine & "..."
sRes = sRes & vbNewLine & "=========================================="
sRes = sRes & vbNewLine & "Computer: " & strComputer
sRes = sRes & vbNewLine & "=========================================="
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_Process WHERE Caption like '%script.exe'" _
, "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each oItem In colItems
sRes = sRes & vbNewLine & "Caption: " & oItem.Caption
sRes = sRes & vbNewLine & "CommandLine: " & oItem.CommandLine
sRes = sRes & vbNewLine & "CreationClassName: " & oItem.CreationClassName
sRes = sRes & vbNewLine & "CreationDate: " & WMIDateStringToDate(oItem.CreationDate)
sRes = sRes & vbNewLine & "CSCreationClassName: " & oItem.CSCreationClassName
sRes = sRes & vbNewLine & "CSName: " & oItem.CSName
sRes = sRes & vbNewLine & "Description: " & oItem.Description
sRes = sRes & vbNewLine & "ExecutablePath: " & oItem.ExecutablePath
sRes = sRes & vbNewLine & "ExecutionState: " & oItem.ExecutionState
sRes = sRes & vbNewLine & "Handle: " & oItem.Handle
sRes = sRes & vbNewLine & "HandleCount: " & oItem.HandleCount
sRes = sRes & vbNewLine & "InstallDate: " & WMIDateStringToDate(oItem.InstallDate)
sRes = sRes & vbNewLine & "KernelModeTime: " & oItem.KernelModeTime
sRes = sRes & vbNewLine & "MaximumWorkingSetSize: " & oItem.MaximumWorkingSetSize
sRes = sRes & vbNewLine & "MinimumWorkingSetSize: " & oItem.MinimumWorkingSetSize
sRes = sRes & vbNewLine & "Name: " & oItem.Name
sRes = sRes & vbNewLine & "OSCreationClassName: " & oItem.OSCreationClassName
sRes = sRes & vbNewLine & "OSName: " & oItem.OSName
sRes = sRes & vbNewLine & "OtherOperationCount: " & oItem.OtherOperationCount
sRes = sRes & vbNewLine & "OtherTransferCount: " & oItem.OtherTransferCount
sRes = sRes & vbNewLine & "PageFaults: " & oItem.PageFaults
sRes = sRes & vbNewLine & "PageFileUsage: " & oItem.PageFileUsage
sRes = sRes & vbNewLine & "ParentProcessId: " & oItem.ParentProcessId
sRes = sRes & vbNewLine & "PeakPageFileUsage: " & oItem.PeakPageFileUsage
sRes = sRes & vbNewLine & "PeakVirtualSize: " & oItem.PeakVirtualSize
sRes = sRes & vbNewLine & "PeakWorkingSetSize: " & oItem.PeakWorkingSetSize
sRes = sRes & vbNewLine & "Priority: " & oItem.Priority
sRes = sRes & vbNewLine & "PrivatePageCount: " & oItem.PrivatePageCount
sRes = sRes & vbNewLine & "ProcessId: " & oItem.ProcessId
sRes = sRes & vbNewLine & "QuotaNonPagedPoolUsage: " & oItem.QuotaNonPagedPoolUsage
sRes = sRes & vbNewLine & "QuotaPagedPoolUsage: " & oItem.QuotaPagedPoolUsage
sRes = sRes & vbNewLine & "QuotaPeakNonPagedPoolUsage: " & oItem.QuotaPeakNonPagedPoolUsage
sRes = sRes & vbNewLine & "QuotaPeakPagedPoolUsage: " & oItem.QuotaPeakPagedPoolUsage
sRes = sRes & vbNewLine & "ReadOperationCount: " & oItem.ReadOperationCount
sRes = sRes & vbNewLine & "ReadTransferCount: " & oItem.ReadTransferCount
sRes = sRes & vbNewLine & "SessionId: " & oItem.SessionId
sRes = sRes & vbNewLine & "Status: " & oItem.Status
sRes = sRes & vbNewLine & "TerminationDate: " & WMIDateStringToDate(oItem.TerminationDate)
sRes = sRes & vbNewLine & "ThreadCount: " & oItem.ThreadCount
sRes = sRes & vbNewLine & "UserModeTime: " & oItem.UserModeTime
sRes = sRes & vbNewLine & "VirtualSize: " & oItem.VirtualSize
sRes = sRes & vbNewLine & "WindowsVersion: " & oItem.WindowsVersion
sRes = sRes & vbNewLine & "WorkingSetSize: " & oItem.WorkingSetSize
sRes = sRes & vbNewLine & "WriteOperationCount: " & oItem.WriteOperationCount
sRes = sRes & vbNewLine & "WriteTransferCount: " & oItem.WriteTransferCount
sRes = sRes & vbNewLine & "."
Next
Next
WScript.Echo sRes
Function WMIDateStringToDate(dtmDate)
WMIDateStringToDate = ( _
Left(dtmDate,4) & "/" & Mid(dtmDate,5,2) & "/" & Mid(dtmDate,7,2) & " " & _
Mid (dtmDate,9,2) & ":" & Mid(dtmDate,11,2) & ":" & Mid(dtmDate,13,2))
End Function