Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Start and Stop Services
Message
 
To
20/07/2015 16:39:05
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01622286
Message ID:
01622330
Views:
83
>>How do you go about turning a service OFF in VFP ( by using code ). And.... turn a Service back On ???
>
>It is pretty much the same thing as in .NET. However, you would need to run a DOS command like this:
>
>
>        ' Enable the task
>        loProcessFile.cWorkingDirectory = "c:\Windows\System32"
>        loProcessFile.cFileName = "c:\Windows\System32\sc.exe"
>        loProcessFile.cArguments = "\\" + lcIP + " start """ + lcService + """"
>        If Not loProcessFile.Process() Then
>            cMessage = loProcessFile.cMessage
>            Return False
>        End If
>
>
>That is .NET code but you can easily adjust as needed.

Thanks for the sample, but I am overlooking something here.

What is loProcessFile here ?

Thanks!
Tommy Tillman A+ NetWork+ MCP
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform