d-taylor Posted January 17, 2013 Posted January 17, 2013 (edited) As discussed in another thread, run on the FRDC to solve many niggly CC4 problems that come up Server 2003 @echo off rem ******************************** rem Unlocks DNS and service host and deletes cache rem ********************************** @echo on net stop /yes "DNS Server" @ECHO Waiting for DNS Server Service To stop :loop2 @REM Wait for 5 seconds @PING 1.1.1.1 -n 1 -w 5000 >NUL @ECHO Checking Service State @sc query "DNS" | @FIND "1 STOPPED" @If %ERRORLEVEL% NEQ 0 goto loop2 @ECHO Confirmed: DNS Server Service stopped net stop /yes "RM Printer Credits Manager Service" @ECHO Waiting for RM Printer Credits Manager Service To Stop :loop5 @REM Wait for 30 seconds @PING 1.1.1.1 -n 1 -w 30000 >NUL @ECHO Checking Service State @sc query "RMAudPrnCredits" | @FIND "1 STOPPED" @If %ERRORLEVEL% NEQ 0 goto loop5 @ECHO Confirmed: RM Printer Credits Manager Service Stopped net stop /yes "RM service Host" @ECHO Waiting for RM service Host To Stop :loop6 @REM Wait for 30 seconds @PING 1.1.1.1 -n 1 -w 30000 >NUL @ECHO Checking Service State @sc query "RM service Host" | @FIND "1 STOPPED" @If %ERRORLEVEL% NEQ 0 goto loop6 @ECHO Confirmed: RM service Host Service Stopped @ECHO Clearing service host cache @REM Wait for 30 seconds del /Q /F "C:\Documents and Settings\All Users\Application Data\RM\Connect\Comms\*.rmcache" del /Q /F "C:\Documents and Settings\All Users\Application Data\RM\Connect\Comms\*.cache" RD /Q /S "C:\Program Files\RM\Connect\Comms\RemotingHost" RD /Q /S "C:\Program Files\RM\Connect\Comms\HostedProxies" net start /yes "RM service Host" @ECHO Waiting for RM service Host To Start :loop7 @REM Wait for 30 seconds @PING 1.1.1.1 -n 1 -w 30000 >NUL @ECHO Checking Service State @sc query "RM service Host" | @FIND "4 RUNNING" @If %ERRORLEVEL% NEQ 0 goto loop7 @ECHO Confirmed: RM service Host Started net start /yes "RM Printer Credits Manager Service" @ECHO Waiting for RM Printer Credits Manager Service To Start :loop8 @REM Wait for 30 seconds @PING 1.1.1.1 -n 1 -w 30000 >NUL @ECHO Checking Service State @sc query "RMAudPrnCredits" | @FIND "4 RUNNING" @If %ERRORLEVEL% NEQ 0 goto loop8 @ECHO Confirmed: RM Printer Credits Manager Service Started net start /yes "DNS Server" @ECHO Waiting for DNS Server Service To start :loop4 @REM Wait for 5 seconds @PING 1.1.1.1 -n 1 -w 5000 >NUL @ECHO Checking Service State @sc query "DNS" | @FIND "4 RUNNING" @If %ERRORLEVEL% NEQ 0 goto loop4 @ECHO Confirmed: DNS Server Service started Server 2008 R2: @echo off rem ******************************** rem Restarts service host and deletes cache rem ********************************** @echo on net stop /yes "RM Printer Credits Manager Service" @ECHO Waiting for RM Printer Credits Manager Service To Stop :loop5 @REM Wait for 30 seconds @PING 1.1.1.1 -n 1 -w 30000 >NUL @ECHO Checking Service State @sc query "RMAudPrnCredits" | @FIND "1 STOPPED" @If %ERRORLEVEL% NEQ 0 goto loop5 @ECHO Confirmed: RM Printer Credits Manager Service Stopped net stop /yes "RM service Host" @ECHO Waiting for RM service Host To Stop :loop6 @REM Wait for 30 seconds @PING 1.1.1.1 -n 1 -w 30000 >NUL @ECHO Checking Service State @sc query "RM service Host" | @FIND "1 STOPPED" @If %ERRORLEVEL% NEQ 0 goto loop6 @ECHO Confirmed: RM service Host Service Stopped @ECHO Clearing service host cache @REM Wait for 30 seconds RD /Q /S "C:\Program Files (x86)\RM\Connect\Comms\HostedProxies" RD /Q /S "C:\Program Files (x86)\RM\Connect\Comms\RemotingHost" del /Q /F "C:\ProgramData\RM\Connect\Comms\*.rmcache" del /Q /F "C:\ProgramData\RM\Connect\Comms\*.cache" del /Q /F "C:\Documents and Settings\All Users\Application Data\RM\Networks\RMMC\CacheManager\*.rmcache" net start /yes "RM service Host" @ECHO Waiting for RM service Host To Start :loop7 @REM Wait for 30 seconds @PING 1.1.1.1 -n 1 -w 30000 >NUL @ECHO Checking Service State @sc query "RM service Host" | @FIND "4 RUNNING" @If %ERRORLEVEL% NEQ 0 goto loop7 @ECHO Confirmed: RM service Host Started net start /yes "RM Printer Credits Manager Service" @ECHO Waiting for RM Printer Credits Manager Service To Start :loop8 @REM Wait for 30 seconds @PING 1.1.1.1 -n 1 -w 30000 >NUL @ECHO Checking Service State @sc query "RMAudPrnCredits" | @FIND "4 RUNNING" @If %ERRORLEVEL% NEQ 0 goto loop8 @ECHO Confirmed: RM Printer Credits Manager Service Started Edited January 17, 2013 by d-taylor
Sibrows Posted January 17, 2013 Posted January 17, 2013 Using the Server 2003 version it appears to get stuck going around in loop2. Am I missing something?
d-taylor Posted January 17, 2013 Author Posted January 17, 2013 I've not needed to use the Server 2003 ones fo ra while. If you are fully up to date with RM updates, you can take the DNS stop and start out, and see if it runs
railfrog Posted February 10, 2013 Posted February 10, 2013 If just the RM Service Host start/stop bits of the script were used, would that be o.k to use on the student machines?
d-taylor Posted February 11, 2013 Author Posted February 11, 2013 You just need to restart the RM Service Host service on student machines, no need to delete any files. If you need to restart RM Service Host on a large number of workstations regularly, I'd recommend logging a call with RM
railfrog Posted February 11, 2013 Posted February 11, 2013 It's for article TEC1395295 on the RM website. "Root Element is Missing" The service host has to be restarted after a certain file is deleted and another renamed. Just want to know if the following would work on the student machines. net stop /yes "RM service Host" @echo Waiting for RM service Host To Stop :loop6 @Rem Wait for 30 seconds @PING 1.1.1.1 -n 1 -w 30000 >NUL @echo Checking Service State @sc query "RM service Host" | @FIND "1 STOPPED" @If %ERRORLEVEL% NEQ 0 goto loop6 @echo Confirmed: RM service Host Service Stopped net start /yes "RM service Host" @echo Waiting for RM service Host To Start :loop7 @Rem Wait for 30 seconds @PING 1.1.1.1 -n 1 -w 30000 >NUL @echo Checking Service State @sc query "RM service Host" | @FIND "4 RUNNING" @If %ERRORLEVEL% NEQ 0 goto loop7 @echo Confirmed: RM service Host Started
randle Posted February 18, 2013 Posted February 18, 2013 The RM Service Host service doesn't need to be restarted after renaming the file in the data access folder. Just rename a valid one and simply assign the package again!
randle Posted February 18, 2013 Posted February 18, 2013 If you do want to restart the RM SH service on remote machines the following script will prompt you for a machine name and do this for you. You will need to download psservice (PsService) and place it in the %windir% of your own computer to be able to remotely manage services but makes the task much easier and convenient should you need to do this from time to time. ::Remote RM Service Host service restart script ::Created by JShand: 12:30 03/08/2012 @echo OFF Set /P Computer=Restart RM Service Host service on computer: ECHO ****STOPPING THE "RM DESKTOP AGENT" SERVICE**** psservice [url="file://\\%Computer%"]\\%Computer%[/url] stop DAService 2>nul ECHO ****RESTARTING THE "RM SERVICE HOST" SERVICE**** psservice [url="file://\\%Computer%"]\\%Computer%[/url] restart "RM Service Host" 2>nul ECHO ****STARTING THE "RM DESKTOP AGENT" SERVICE**** psservice [url="file://\\%Computer%"]\\%Computer%[/url] start DAService 2>nul @echo ****CHECKING SERVICE STATES**** :check1 @psservice [url="file://\\%computer%"]\\%computer%[/url] query "DAService" | @FIND "4 RUNNING" 2>nul @If %ERRORLEVEL% NEQ 0 goto :DAstopped @If %ERRORLEVEL% EQU 0 goto :DAstarted :DAstopped @echo RM Desktop Agent service is NOT running on %Computer% goto :check2 :DAstarted @echo RM Desktop Agent service RESTARTED on %Computer% :check2 @psservice [url="file://\\%computer%"]\\%computer%[/url] query "RM Service Host" | @FIND "4 RUNNING" 2>nul @If %ERRORLEVEL% NEQ 0 goto :SHstopped @If %ERRORLEVEL% EQU 0 goto :SHstarted :SHstopped @echo RM Service Host service is NOT running on %Computer% goto :end :SHstarted @echo RM Service Host service RESTARTED on %Computer% :end @PAUSE 1
railfrog Posted February 20, 2013 Posted February 20, 2013 Thanks for that. Will give it a go tomorrow.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now