Avatar of DonnaOsburn
DonnaOsburn
Flag 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!
DB Dev ToolsProgrammingSystem Programming

Avatar of undefined
Last Comment
DonnaOsburn

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
DonnaOsburn

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy