Articles → .NET WINDOWS SERVICE → How to start your windows service automatically when server gets restartedHow to start your windows service automatically when server gets restartedThis week, we encountered a strange problem where windows service does not start when the server gets restarted even the startup type of windows service is automatic.To fix that issue, our team has worked on one approach which I want to share it with you. The approach is - 1. Create a batch file and write following command to start the servicenet start service_name 2. Copy the batch file in startup folder (C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp).So once the server is restarted, the batch file in startup folder gets executed and windows service gets restarted using net start command.Posted By - Karan Gupta Posted On - Thursday, November 30, 2017 Query/Feedback Your Email Id Subject Query/Feedback Characters remaining 250
net start service_name
Query/Feedback