Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check if program running on remote pc

Status
Not open for further replies.

alpder

Technical User
Sep 22, 2002
103
AU
I have set up a networked PC as a slave running many scheduled tasks which among other things create reports and email them to our customers.
We are a manufacturing company and get orders electronically from a large customer. We use their software on this slave pc to download orders from the internet. The program must stay open and every 30 minutes, it checks for new orders. As the slave PC is not on someone's desk where it can be checked periodically (to ensure it hasn't crashed), I need to test that the PC is running (which I have done) but I cannot work out how to test if the required program is running on the slave. When I have found out how to do it, I would code it in an Access module.
This may not be the most apprpriate forum for this problem but I have done a lot of searching to no avail.

I would be grateful for any help.
 
Something like this ?
Public Function isRunning(strComputer As String, strName As String) As Boolean
On Error Resume Next
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Process",,48)
For Each objItem in colItems
If Trim(objItem.ExecutablePath & "") <> "" Then
If LCase(objItem.Name) = LCase(strName) Then
isRunning = True
Exit Function
End If
End If
Next
isRunning = False
End Function

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top