Tested on Windows 10, 64bit
When you work with PC Worx SRT, one annoying thing is that its service runs in the background even if you exit it and prevents your computer to enter into sleep mode. You have to stop it from the Task Manager. And once stopped, on win 10, it will not automatically start when you open again the program.
Probably this will be fixed in future updates but until then, here is a simple batch code that would toggle the status. But there is a catch: you have to run it as administrator. See below what’s needed.
Jump to
Step1: Create the file
- echo off
- echo PC WORX SRT will be toggled, note that you need to Run as Administrator
- echo See here how: http://online-training.ro/toggle-pc-worx-srt-service
- for /F "tokens=3 delims=: " %%H in ('sc query "PC WORX SRT" ^| findstr "STATE"') do (
- if /I "%%H" == "RUNNING" (
- net stop "PC WORX SRT"
- ) else (
- net start "PC WORX SRT"
- )
- )
- echo If it wasn't successful, drop a line on the above mentioned
- echo web page and start/stop manually from Task manager, Services tab
- pause
Copy the code and put it in Notepad. Save the file with .bat extension.
Note: if extensions are not displayed on your computer the file will get an invisible .txt at the end. Make sure the saved file is not a simple text one.
Step2: Make shortcut on Desktop
Select the file, ctrl+v, go to Desktop and right-click on an empty space and select Paste as shortcut.
Step3: Make it to run as administrator
Right-click on the shortcut and select Properties=>Shortcut. Click on Advanced.
Here, check Run as Administrator. Then Ok, Ok.
Use this shortcut anytime you need to change the status of the PC Worx SRT service. You’ll be prompted to allow changes on your computer, click Yes.
Alternate script, keeping the window alive
Use this script instead. To run it, you could simply to right-click on it and select Run as Administrator or create a shortcut as above. Once the toggle was done the script asks you if you want to keep the window open and will wait for your input. It’s pretty much the same as keeping Task Manager open and toggle from there.
- echo off
- echo.
- echo.
- echo PC WORX SRT will be toggled, note that you need to Run as Administrator
- echo See here how: http://online-training.ro/toggle-pc-worx-srt-services/
- echo.
- :start_doing
- echo.
- for /F "tokens=3 delims=: " %%H in ('sc query "PC WORX SRT" ^| findstr "STATE"') do (
- if /I "%%H" == "RUNNING" (
- net stop "PC WORX SRT"
- ) else (
- net start "PC WORX SRT"
- )
- )
- echo.
- echo Type Y to run again and keep this window open.
- echo This way you can avoid the Run as Administrator dialog on the next run.
- echo Type N to end it.
- choice /c YN /m "Run again and keep window open?"
- if errorlevel=2 goto end_doing
- if errorlevel=1 goto start_doing
- :end_doing
- echo.
- echo.
- echo If it wasn't successful, drop a line on the above mentioned
- echo web page and start/stop manually from Task manager, Services tab
- echo.
- echo.
- pause