Jump to content
Sign in to follow this  
KenzoIT

Services Status

Recommended Posts

KenzoIT

Hi all,

I would like to check services status on the server such as zabbix_agent.exe, snmp.exe, vmware-authd.exe,...And, this is my code :

$ProcessName = "zabbix_agentd.exe"

If ProcessExists($ProcessName) Then

MsgBox(0,"Services Status",$ProcessName & " is running.")

Else

MsgBox(0,"Services Status",$ProcessName & " is not running.")

EndIf

I don't know how to do it in order to show all services in MsgBox ?

Please instruct me to this case.

Thanks !

Edited by KenzoIT

Share this post


Link to post
Share on other sites
MrMitchell

Something like this maybe?

$processList = "explorer.exe,scite.exe,taskmgr.exe"
$aProcessList = StringSplit($processList, ',', 2)
$msgBoxString = ""

For $each In $aProcessList
    If ProcessExists($each) Then
        $msgBoxString &= $each & " is running." & @CRLF
    Else
        $msgBoxString &= $each & " is not running." & @CRLF
    EndIf
Next

MsgBox(0, "Service Status", $msgBoxString)
Edited by MrMitchell

Share this post


Link to post
Share on other sites
KenzoIT

Here is what I need.

Thanks for your instruction ! :idea:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×