Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
HowTo list Services available on the computer
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00815556
Message ID:
00815576
Views:
23
This message has been marked as the solution to the initial question of the thread.
>Is there a way to programmatically get a list of available Services (as they are viewed from ControlPanel->Services)?
>If so, howto programmatically stop/pause/continue/start the particular one?
>
>Thanks in advance

Yuri,
You could use ADSI to do this:
local locomputer, loservice

locomputer = getobject("WinNT://MyDomain/MyComputer,computer")
for each loservice in locomputer
   if upper(loservice.Class) = 'SERVICE' then
      do case
         case loservice.Status = 1
            * service stopped
            loservice.Start
         case loservice.Status = 4
            * service started
            loservice.Stop
      endcase
   endif
endfor
For more information, check out the IADsService interface in MSDN.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform