PDA

Click to See Complete Forum and Search --> : Program to start a service on W2k


dhansen
Sep 13th, 2001, 11:15 AM
Any one know how to start and stop a service with Visual Basic? Using windows 2000 server.

Thanks.

Mad_Phil
Sep 13th, 2001, 09:20 PM
Below is a list of API's that I have, unfortunatly I can't seem to find the program that I put them in ??? It must be somewhere on the hard disk. But anyway you could try searching msdn for them. If you have no luck I can search harder for the program if you want.

Declare Function OpenService Lib "advapi32.dll" Alias "OpenServiceA" (ByVal hSCManager As Long, ByVal lpServiceName As String, ByVal dwDesiredAccess As Long) As Long

Declare Function StartService Lib "advapi32.dll" Alias "StartServiceA" (ByVal hService As Long, ByVal dwNumServiceArgs As Long, ByVal lpServiceArgVectors As Long) As Long

Declare Function CloseServiceHandle Lib "advapi32.dll" (ByVal hSCObject As Long) As Long

Declare Function ControlService Lib "advapi32.dll" (ByVal hService As Long, ByVal dwControl As Long, lpServiceStatus As SERVICE_STATUS) As Long