Link to home
Start Free TrialLog in
Avatar of DonnaOsburn
DonnaOsburnFlag for United States of America

asked on

Check Service Status on Remote PC via VFP

I have found code for VFP which lets me determine if a service is running and stop it or find out all it's information.

However, I am running a desktop application and have services failing on the Server where the SQL Data is stored.

How can I determine via VFP (if possible) if a service is running on a different PC given the IP address or Machine Name - or something.
Local loWbemServices, loServicesCollection, loService
loWbemServices = GetObject("winmgmts:\\.")
loServicesCollection = loWbemServices.InstancesOf("Win32_Service")
 
For Each loService In loServicesCollection
   ? '----'
   loProperties = loService.Properties_
   For Each loProperty IN loProperties
       lcProperty = loProperty.Name
       ? lcProperty,':', loService.&lcProperty
   Endfor
Endfor

Open in new window


This is awesome for my PC, but I need to know if the main services are running on the server.

I am even willing to put a job in SQL and store status in a table and have desktop pull from the table... I just need to know if those services are up or down!
ASKER CERTIFIED SOLUTION
Avatar of DonnaOsburn
DonnaOsburn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial