Startup Service
Last updated
Last updated
Once the system reboots, our fronhand and backend service needs to be restarted. To avoid this issue, we need to create a startup service.
Once the system reboots, our backend service needs to be restarted. To avoid this issue, we need to create a startup service. On a Windows server, we can add a command and associate it with the Windows Task Scheduler.
Create a folder anywhere on your system; however, we recommend creating a folder named "StartupService" within the same hierarchy where your frontend and backend code is located.
Go inside the folder, open Notepad or Notepad++, and write the command to start the service. For example, if your backend code is in the D drive under the "QAautoMATER_Service" folder, write the following command: (Change the Path according the location)
D:
cd D:\QAautoMATER_Solution\QAautoMATER_Service
pm2 start server.js
Save this file as UI_StartUP.bat (Please note this should be .bat file)
Search Task Scheduler in window search bar and click on it
Click on Create Task from right panel section
Enter The name , select the radio button for "Run Whether user is log in or not' is and select Run with highest Previlage checkbox from the general tab
Go to Triggers tab and click New button, seect Begin the task as 'At Startup' and click Ok button
Now go to Action tab and Click on New Tab , select the batch file path and click on Ok button
Click on OK button after Password , Task will created and QAautoMATER backed will up in case of system reboot as well