technolutions
asked on
Running a batch file when a service stops.
I want to setup my servers so that when a windows service stops that it runs a batch file which triggers a .ps1 script that sends me a mail. I know that my bat file works but how can I make windows run that bat file when a service stops?
ASKER
My browse button is grayed out?!
ASKER
If I type in the path of the batch file without browsing it doesn't work when I stop the service.
Did you select "Run a program" from "first failure" drop down list ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Click Start -> Run -> Services.msc -> Right click on Service -> Properties -> Recovery -> Under First failure drop down list select "Run a program" -> Click browse button and select batch file that you want to run.
Hope this helps!
Farhan