- Open Notepad (Start > in search type notepad and select when found).
Note: You may need to run notepad with elevated privileges if you want to save the file to the root of C:\ (right-click and select Run as administrator when found from the search results).
- Add the following lines in the open text file:
- net stop servicenamehere
-
net start servicenamehere
Example: net stop SereniDsService / net start SereniDsService
Notes:- To locate the correct service name, right-click the service in Services and select Properties, use the "Service Name:".
- Add a /y to the end of the line to stop the service as well as all dependant services. Example: net stop "DS FrameServer Service" /y
- If the service is slow to stop it could cause a failure when trying to start the service, add the following command to create a pause between the stop and start of the service(s). timeout /t 10 (10 = 10 seconds, can change to suite needs).
- In Notepad click on the File menu and select Save As.
- In the Save As window select your save destination (example C:\), then at the bottom under Save as Type: click the drop down menu and select "All Files (*.*)".
Type a name for the file and save with the .BAT extension.
- Run the .bat file to verify the service restarts.
- Navigate to the saved file and right-click > select Run as administrator.
- Verify the command prompt comes up and you see the service stopping and then starting.
-
- Open Task Scheduler (Start > in search type Task Scheduler and select when found).
- Once Task Scheduler opens, in the right column window click on Create Task...
- In the General tab, type a name for the service. Enable the "Run whether user is logged on or not" and "Run with highest privileges".
- Click OK
- On theTriggers tab select New...
- Begin the task: On a schedule
- Settings: Select the option needed...e.g. Daily
- Select the Start: day and time the task will start triggering. If set for Daily, Weekly or Monthly the time configured will be used for the recurring triggers.
- Click OK
- On the Actions tab, click New...
- Action: Start a program
-
Program/script: click the Browse... button and navigate to your saved .bat file.
- Click OK
- Leave the rest of the settings default and slect OK again to create the task. You will be prompted to enter user credentials with administrative rights if "Run with highest privileges" was selected.
If running on a DSSRV use the DSServiceUser user credentials.
- Now click on Task Scheduler Library folder in the left column, verify the schedule has been created and is listed.