New
#1
Batch File Help
I've never dabbled much in batch files, as I've usually been able to find pre-made ones to do what I wanted. We have an application that handles user data backups. It has three services, and at times, one or two of the three don't start automatically. If you stop and start the services, all is well. I found a batch file template and edited to suit my needs, however, it sames to fail if a service is stopped already, and doesn't try to restart it.
So, my question, is there a method to say if a service is running, stop it. If not, move along to the next line? I had assumed this would have happened by default, but it doesn't. Here is the start and stop lines in my file:
net stop "Backup Agent"
net stop "Backup Extender"
net stop "Backup Updater"
net start "Backup Agent"
net start "Backup Extender"
net start "Backup Updater"
I would need some kind of "if" to go with the three net stop lines. Does something like that exist?