In a action script I have 18 services to check that is installed and if not running start the service. I don’t want to create a fixlet for each one checking for state of running service and then take action. So in the action script i would like to check the service is installed and state of running or not, so that i can build this wihtinone fixlet and run the same process for each of the 18 services. I know i can run the waithidden sc start “MyService” and if running will just error code and service will still be running. how can i do that cleaner?
first action line
if exists services whose (service name of it =“MYSERVICE” AND state of it as string != “running”)
ACTION:
waithidden sc start “MYSERVICE”
second action line (…16)
if exists services whose (service name of it =“MYSERVICE2” AND state of it as string != “running”)
ACTION:
waithidden sc start “MYSERVICE2”