I have a service well running and configured on my windows OS The service runs as the PC starts, but some times it crashes when there is no internet connection on PC boot and due to that, it does not start at all. My goal is to let that service restart on failure for a few seconds until internet is back else. I've followed what is written in the Microsoft documentation and I used the "sc.exe" commandline tool to accomplish this. Here is the command I've used:
C:\Windows\System32\sc.exe failure $nameOfService reset= 10 actions= restart/1000/restart/5000/restart/100000
But, when I test my service, it does not restart. Please is there something wrong with the above command ?