I have two objectives with this vbscript that I am having trouble with.
1. I can get a list of running processes, but I cannot get the process path.
2. I would like to also see all of the modules loaded by a process. I can achieve this very easily with powershell, but I'm having trouble with vbscript.
My script is very basic so far...
Set objShell = CreateObject("WScript.Shell")
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process")
For Each objProcess in colProcess
wscript.echo objprocess.path
Next
"Path" is not a valid property.
As mentioned, with PS, I can achieve very easily, but for this project it needs to be done in vbs.
PS equivelent: get-process | select -expand modules
Any help is appreciated. Thanks.
1. I can get a list of running processes, but I cannot get the process path.
2. I would like to also see all of the modules loaded by a process. I can achieve this very easily with powershell, but I'm having trouble with vbscript.
My script is very basic so far...
Set objShell = CreateObject("WScript.Shell")
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process")
For Each objProcess in colProcess
wscript.echo objprocess.path
Next
"Path" is not a valid property.
As mentioned, with PS, I can achieve very easily, but for this project it needs to be done in vbs.
PS equivelent: get-process | select -expand modules
Any help is appreciated. Thanks.