|
-
Feb 20th, 2002, 10:58 AM
#1
Thread Starter
Frenzied Member
Search for running processes on another machine
I want to check for a running program on another computer (which can be accessed through Network Neighbourhood). I only know the filename of the program.
I've been looking at EnumProcesses, but I'm not sure how to make this do what I want.
I'm developing for NT.
Can anyone help?
This world is not my home. I'm just passing through.
-
Feb 20th, 2002, 12:36 PM
#2
Black Cat
It's possible to do this with WMI across a network thru the Win32_Process Class, but you need WMI installed, so if you're running less than Windows 2000 you probably don't have it installed.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Feb 21st, 2002, 05:00 AM
#3
Thread Starter
Frenzied Member
Thanks Josh,
I'm experimenting with the following code. Do you think I'm going to get anywhere? I'm not actually looking for Excel at the end of the day, I want to find out if a program called dl_rp.exe is running.
It's been suggested that I write a server to sit on the remote machines and then interrogate it to find out if dl_rp.exe is running. I'd prefer not to do this because it means ensuring that the end-user installs the server.
I had also started looking at WMI but came to the conclusion that I could spend a lot of time not making it work!
VB Code:
Function GetVersion()
Dim XLApp
Set XLApp = CreateObject("Excel.Application", "Uglow")
GetVersion = XLApp.Version
End Function
Tris.
This world is not my home. I'm just passing through.
-
Feb 21st, 2002, 11:57 AM
#4
Black Cat
If this program is not COM / ActiveX, I don't think the CreateObect will work.
There is a utility called pslist.exe available for free at http://www.sysinternals.com that can list processes on a remote computer on an NT network, so there is definately a way to do this via API. However, looking at the program in Depends doesn't really give any API hints.
I found this article while searching, maybe the PSAPI.DLL can work remotely? http://support.microsoft.com/default...;EN-US;q187913
As for WMI, it's pretty easy to do - add a reference to Microsoft WMI Scripting Library, then go
VB Code:
'Windows Management Instrumentation Objects
Dim wmiLocator As WbemScripting.SWbemLocator
Dim wmiContext As WbemScripting.SWbemNamedValueSet
Dim wmiServices As WbemScripting.SWbemServices
'Hardware object representations
Dim cpu As Object 'cpu
Dim cpus As Object 'collection of cpus
Set wmiLocator = New WbemScripting.SWbemLocator
Set wmiContext = New WbemScripting.SWbemNamedValueSet
On Error GoTo Err_CannotConnect
Set wmiServices = wmiLocator.ConnectServer(strComputer, "root\cimv2", , , , , , wmiContext)
On Error GoTo 0
Set cpus = wmiServices.InstancesOf("Win32_Processor")
For Each cpu In cpus
lstProcessors.AddItem cpu.CurrentClockSpeed & " Mhz"
Next
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Feb 22nd, 2002, 12:12 PM
#5
Thread Starter
Frenzied Member
Fantastic!
Thanks Josh, the pslist.exe works great.
I'm having a little trouble running it and capturing the output though. (Not a problem with pslist, just an issue with Shelling it out).
Tris.
This world is not my home. I'm just passing through.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|