How do I remove a service?
How would I remove a service? I have seen Net Start and Net Stop but how about to delete? I want to delete a service with my installer after it is finished. My installer lets me run an app after its done so i want to call a command to remove a service.
Thanks
Re: How do I remove a service?
RobDog's post may help:
VB Code:
Private Sub NTService1_Start(Success As Boolean)
Private Sub NTService1_Stop()
Private Sub NTService1_Pause(Success As Boolean)
Private Sub NTService1_Continue(Success As Boolean)
'Set the .DisplayName and .ServiceName
'It requires some commandline parameters to get it going.
'-install
'-uninstall < ------------------ HERE
'-start
'-stop
'-debug
Re: How do I remove a service?
The code David is refering to is dependent upon the NTSrv.ocx control.
If you want to uninstall a service check out some of the service orientated
APIs like OpenSCManager, CreateService, etc. but you would need the
appropriate permissions to uninstall a service that you did not create.