garychu
asked on
Setting up notification of an NT service state
I use a command;
net start "<service-name>" to start and
net stop "service-name>" to stop the service.
I do this in a batch file, scheduled to run unattended.
Are there command(s) I can include in the batch file to check if the service starts/stop successfully? Such that if a return code is detected, I could then use a utility, say, Postie to email out notifications to individuals.
Given the objective, would this be so old world, and that there are more contemporary ways of doing so?
Thanks, Experts.
net start "<service-name>" to start and
net stop "service-name>" to stop the service.
I do this in a batch file, scheduled to run unattended.
Are there command(s) I can include in the batch file to check if the service starts/stop successfully? Such that if a return code is detected, I could then use a utility, say, Postie to email out notifications to individuals.
Given the objective, would this be so old world, and that there are more contemporary ways of doing so?
Thanks, Experts.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, Experts.
I am grateful for the trouble taken and the benefits of knowledge and experience shared.
I think I now have enough to try out a few things before coming to a final solution.
Cheers
I am grateful for the trouble taken and the benefits of knowledge and experience shared.
I think I now have enough to try out a few things before coming to a final solution.
Cheers
No problem.... Just ask another q if you need more and we'll see it.
i hadnt seen that list of error codes before for net.exe so is useful here too.
Should be able to use sc.exe too if available i suppose.
Garychu -has that given you enough between us (pls split points of course) or need some more clarification?
steve