Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

New to AutoIt - Display data into one MSG box

$
0
0

I managed to get this much together but having trouble cleaning up the script to display all the services and tasks into one msg box with status and green check box for running services and red X for failed services. Is that even possible? HELP!  :sweating:

ConsoleWrite(_IsServiceRunning('RSMgmtSrvc') & @CRLF)
ConsoleWrite(_IsServiceRunning('RemovableStorageService') & @CRLF)
ConsoleWrite(_IsServiceRunning('EAFRCliNP') & @CRLF)
ConsoleWrite(_IsServiceRunning('EAFRCliManager') & @CRLF)
 
; Check if a service is running.
Func _IsServiceRunning($sService)
    Local $oShell = ObjCreate('shell.application')
    If @error Then
        Return SetError(1, 0, False)
    EndIf
    Return $oShell.IsServiceRunning($sService)
 
EndFunc   ;==>_IsServiceRunning
 
; Check if Process is running.
$ProcessName1 = "RemovableStorageMgmtService.exe"
If ProcessExists($ProcessName1) Then
MsgBox(0,"Running",$ProcessName1 & " is running.")
Else
MsgBox(0,"Not Running",$ProcessName1 & " is not running.")
 
EndIf
$ProcessName2 = "EAFRCliStart.exe"
If ProcessExists($ProcessName2) Then
MsgBox(0,"Running",$ProcessName2 & " is running.")
Else
MsgBox(0,"Not Running",$ProcessName2 & " is not running.")
 
EndIf
$ProcessName3 = "RemovableStorageService.exe"
If ProcessExists($ProcessName3) Then
MsgBox(0,"Running",$ProcessName3 & " is running.")
Else
MsgBox(0,"Not Running",$ProcessName3 & " is not running.")
 
EndIf
$ProcessName4 = "EACommunicatorSrv.exe"
If ProcessExists($ProcessName4) Then
MsgBox(0,"Running",$ProcessName4 & " is running.")
Else
MsgBox(0,"Not Running",$ProcessName4 & " is not running.")
 
EndIf
$ProcessName5 = "EAFRCliManager.exe"
If ProcessExists($ProcessName5) Then
MsgBox(0,"Running",$ProcessName5 & " is running.")
Else
MsgBox(0,"Not Running",$ProcessName5 & " is not running.")
 
EndIf
$ProcessName6 = "RSGUIProvider.exe"
If ProcessExists($ProcessName6) Then
MsgBox(0,"Running",$ProcessName6 & " is running.")
Else
MsgBox(0,"Not Running",$ProcessName6 & " is not running.")
 
EndIf

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>