I want to create a script for Exchange view. The script must run the following command:
wmic process list brief | find "store.exe"
If it finds store.exe running, then the output is successful.
you may want to look at Monitoring the service using the Mon-set's as opposed to a re-occuring script that manually checks the script. The Monitor Set will give you more options.
Under Monitor, Monitor Sets, create a monitor set and use the "Process Status" button.
Once you created your monitor set, you can apply it (assign monitoring) and choose the actions on the alarm trigger. hope it helps.
If you still want a procedure take a look at the If statements mainly the check app running or service running, those may do what you like, but I'd recommend using the monitor set, it's more reliable and you could use a script triggered after that as well to do more options.