Howdy - I am hoping someone can assist me with creating a task or fixlet that will stop and disable a service if it exists and then another that will enable a service and start it if it exists.
I have found a couple things I am testing, but so far no luck. I did find the commands below which I am testing now. But what I want to do is add an Else statement if possible, so if “service1” does not exist, then look for another service as the name is going to be 1 of 2 possibilities.
IE: If Messenger doesn’t exist then goto another statement and there I can specify “Messenger2” as the name of the service. This will allow me to create 1 action to do what I am tasked with to stop and disable these 2 services, and 1 to enable and start them, as opposed to 4 separate items. Can anyone assist?
if {(exists service “Messenger” and state of service “Messenger” as lowercase = “running”)}
WAITHIDDEN CMD.EXE /C NET STOP "Messenger"
wait “{pathname of client folder of site “BESSupport” & “\changeservicestartmode”}” “Messenger” disabled