WMI & VBS reporting window title or URL currently visiting

09-13-2004, 08:20 AM
I'm in the process of using WMI to report general information about a remote machine. This is a skeleton of what I have so far.

On Error Resume Next
strComputer=inputbox("Enter the computer name or its ip address : -" & vbcrlf & vbcrlf & _
"Local computer can be ""."" or """"", _
"Search for default printer on a Computer",".")
if IsEmpty(strComputer) then wscript.echo "Operation is aborted by user." : wscript.quit(1)

set wbemservices = GetObject("Winmgmts:\\" & strComputer)
set wbemObjectSet = wbemServices.InstancesOf ("win32_LogicalMemoryConfiguration")
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Process",,48)
Set colNetwork = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration",,48)

For each wbemobject in wbemobjectset
WScript.echo "Tot Physical Memory " & wbemobject.totalPhysicalMemory

For Each objItem in colItems
Wscript.Echo "Caption: " & objItem.Caption & vbCRLF & _
"Handle: " & objItem.Handle & vbCRLF & _
"Name: " & objItem.Name & vbCRLF & _
"Process ID " & objItem.ProcessId

For Each objItem in colNetwork
Wscript.Echo "Database Path: " & objItem.DatabasePath

Now, what I would like to add to this is something that could report in the same message box that reports parent and child window titles for each process. I've exhausted a lot of time attempting to make various solutions work for this specific code. Does anyone have a remedy? I thank anyone in advance for any help in this matter.

09-16-2004, 05:01 PM
I might have either worded this wrong, or maybe have asked a confusing question in general. I'm looking to perform a function similar to this :

For each objItem.Name = "IEXPLORE" in colItems
Wscript.Echo "Window Title" & objectItem.WindowTitle

Now, I am fully aware there is no property such as WindowTitle. Is there another method to perform this in either VBS or WMI? I'll be glad to take advice in ANY direction.

To put it simply, I want to finish this script to report activity on a workstation on a network. This script could validate if there is spyware loaded, or if a remote workstation is running an application. I already have scripts in place to kill a process based on handle. I'm simply looking to get a better description of various "Child" windows of a given process.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum