Results 1 to 5 of 5

Thread: Search for running processes on another machine

  1. #1

    Thread Starter
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536

    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.

  2. #2
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    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.

  3. #3

    Thread Starter
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536
    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:
    1. Function GetVersion()
    2.    Dim XLApp
    3.    Set XLApp = CreateObject("Excel.Application", "Uglow")
    4.    GetVersion = XLApp.Version
    5. End Function


    Tris.
    This world is not my home. I'm just passing through.

  4. #4
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    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:
    1. 'Windows Management Instrumentation Objects
    2.     Dim wmiLocator As WbemScripting.SWbemLocator
    3.     Dim wmiContext As WbemScripting.SWbemNamedValueSet
    4.     Dim wmiServices As WbemScripting.SWbemServices
    5.     'Hardware object representations
    6.     Dim cpu As Object 'cpu
    7.     Dim cpus As Object 'collection of cpus
    8.  
    9. Set wmiLocator = New WbemScripting.SWbemLocator
    10.     Set wmiContext = New WbemScripting.SWbemNamedValueSet
    11.     On Error GoTo Err_CannotConnect
    12.     Set wmiServices = wmiLocator.ConnectServer(strComputer, "root\cimv2", , , , , , wmiContext)
    13.     On Error GoTo 0
    14.    
    15.     Set cpus = wmiServices.InstancesOf("Win32_Processor")
    16.     For Each cpu In cpus
    17.         lstProcessors.AddItem cpu.CurrentClockSpeed & " Mhz"
    18.     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.

  5. #5

    Thread Starter
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536
    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
  •  



Click Here to Expand Forum to Full Width