I wanted to add a message box to the end of the script that would appear if the service wasn't running and it was restarted.
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
strComputer = "."
strServiceName = "Service"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Service Where Name='" & strServiceName & "'",
"WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems
If objItem.State <> "Running" Then objItem.StartService()
If this restarts the service, it would pop a message box saying the service was restarted.