Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Processes Path (remote pc)

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,1746
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Processes Path (remote pc)
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Processes Path (remote pc) - 12/23/2004 11:55:36 PM   
  Weazle

 

Posts: 1
Score: 0
Joined: 12/23/2004
From:
Status: offline
Based on wmi, I created in Visual basic 6 a sub to view processes from a remote pc.
(That is for a tool i will use at work here)

Now, I can see the name and if i like the Id etc..

But what i can't see and would like to see, is the locations of the process( for example, notepad.exe is stored on that pc on c:\windows\system32\notepad.exe)
So the full path.

And also the Cpu time(to check if a process takes 99% cpu or not)

Can anybody help me with that?

I'll post my code that i already used for showing the name.

Private Sub Processen_Weergeven()
Dim StrVorige As String
Dim IntTeller As Integer

On Error GoTo Foutmelding

StrVorige = ""
StrSelected_Process = ""
IntTeller = 0
LstProcesses.ListItems.Clear
LstProcesses.ColumnHeaders.Add 1, , "", 5000

Set objDictionary = CreateObject("Scripting.Dictionary")

StrComputer = Me.Tag

Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & StrComputer & "\root\cimv2")

Set colProcesses = objWMIService.ExecQuery("Select * from Win32_Process")
For Each objProcess In colProcesses
objDictionary.Add objProcess.ProcessID, objProcess.Name
Next

Set colThreads = objWMIService.ExecQuery("Select * from Win32_Thread")

For Each objthread In colThreads
intProcessID = CInt(objthread.processhandle)

If (Vorige <> intProcessID) Then
strProcessName = objDictionary.Item(intProcessID)

Set mItem(IntTeller) = LstProcesses.ListItems.Add(1, , strProcessName)
IntTeller = IntTeller + 1
End If
Vorige = intProcessID
Next

LstProcesses.Sorted = True
CmdProcessKill.Enabled = False

Exit Sub

Foutmelding:
MsgBox "Er is een fout opgetreden bij het inlezen van de Processen.", vbCritical, "Error: Processen_Weergeven"
Unload Me
End Sub


Thx in advance

Edit: just info, the lstprocesses is a listview, but that isn't importent
 
 
Post #: 1
 
 Re: Processes Path (remote pc) - 12/24/2004 12:44:50 AM   
  Snipah


Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
Er zijn proggies beschikbaar die dit allemaal laten zien, wel zo gemakkelijk...

ActiveXperts Network Monitor 5.5


(in reply to Weazle)
 
 
Post #: 2
 
 Re: Processes Path (remote pc) - 12/24/2004 2:38:01 AM   
  Bill Taylor

 

Posts: 4
Score: 0
Joined: 12/24/2004
From: USA
Status: offline
The property ExecutablePath will give you the full path. I don't find a property that will show the CPU usage.

(in reply to Weazle)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Processes Path (remote pc) Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts