Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim listaSvcs() As ServiceProcess.ServiceController
- Dim SingleSvc As Object
- iniservice:
- listaSvcs = ServiceProcess.ServiceController.GetServices
- Try
- For Each SingleSvc In listaSvcs
- If SingleSvc.ServiceName.IndexOf("postgresql") >= 0 And SingleSvc.StartType.ToString <> "Disabled" Then
- If SingleSvc.Status <> ServiceProcess.ServiceControllerStatus.Running Then
- 'MessageBox.Show(SingleSvc.StartType.ToString)
- SingleSvc.Start()
- GoTo iniservice
- End If
- End If
- Next
- Catch ex As Exception
- MessageBox.Show(ex.Message)
- End Try
Add Comment
Please, Sign In to add comment