strComputer = "."
Set objWMIService = GetObject("winmgmts:" _& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSettings = objWMIService.ExecQuery _("Select * from Win32_ComputerSystem")
For Each objComputer in colSettings
wscript.echo objComputer.Name
Next
This code will echo PC's name in which it's executed .
strComputer = "."
instances = 0
processName = "chrome.exe"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colProcess = objWMIService.ExecQuery("Select * from Win32_Process")
For Each objProcess in colProcess
If objProcess.Name = processName Then instances = instances + 1
Next
wscript.echo "Process - "&processName&" has "&instances&" instances running."
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_DesktopMonitor",,48)
For Each objItem in colItems
WScript.Echo "ScreenHeight: " & objItem.ScreenHeight
WScript.Echo "ScreenWidth: " & objItem.ScreenWidth
Next