Global $aSvcNames[] = ['AdobeARMservice','Adguard Service','AGSService','GsServer','PSI_SVC_2', 'SbieSvc', 'SQLWriter', 'VMnetDHCP', 'VMware NAT Service', 'VMAuthdService', 'VMUSBArbService', 'WebDriveService','YandexBrowserService', 'Zoolz 2 Service', '{0CBD4F48-3751-475D-BE88-4F271385B672}']
Global $aProcNames[] = ['Adguard.exe', 'AdobeARM.exe','DefenderDaemon.exe','DTShellHlp.exe','elements64.exe','Ext2Mgr.exe','SbieCtrl.exe', 'SynTPEnh.exe', 'SynTPHelper.exe', 'TrueImageMonitor.exe','TibMounterMonitor.exe','vmware-tray.exe']
For $Name In $aSvcNames
_Service_Stop($Name)
Sleep(300)
Next
For $Name In $aProcNames
ProcessClose($Name)
Next
Func _Service_Start($sService, $Computer = ".")
ConsoleWrite($sService & @CRLF)
Local $objWMI = ObjGet("winmgmts:\\" & $Computer & "\root\cimv2")
If Not(IsObj($objWMI)) Then Return SetError(-2)
Local $strQuery = "Select * from Win32_Service Where State = 'Stopped' And " & _
"Name Like '"& $sService & "'"
Local $colItems = $objWMI.ExecQuery($strQuery)
If Not(IsObj($colItems)) Then Return SetError(-2)
For $objItem in $colItems
Return $objItem.StartService($objItem.Name)
Next
Return SetError(-1)
EndFunc ;==> _Service_Start()
Func _Service_Stop($sService, $Computer = ".")
ConsoleWrite($sService & @CRLF)
Local $objWMI = ObjGet("winmgmts:\\" & $Computer & "\root\cimv2")
If Not(IsObj($objWMI)) Then Return SetError(-2)
Local $strQuery = "Select * from Win32_Service Where State = 'Running' And " & _
"name like '"& $sService &"'"
Local $colItems = $objWMI.ExecQuery($strQuery)
If Not(IsObj($colItems)) Then Return SetError(-2)
For $objItem In $colItems
Return $objItem.StopService($objItem.Name)
Next
Return SetError(-1)
EndFunc ;==> _Service_Stop()