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?