Wednesday, April 29, 2009

Restart Citrix Print Manager Service on spooler crash

When Windows Print Spooler crashes, Citrix Print Manager Service becomes lost in space and session printers are no longer created. Here is a little .bat file to restart the Windows print spooler and the Citrix Print Manager Service automatically when the print spooler crashes. Obviously this does not fix the root issue of the spooler service crashing.


Save as AutoSet-RestartCitrixPrintSpoolerOnCrash.bat and run it directly or attach it to a GPO. Then go to Services.msc -> Print Spooler -> Properties -> Recovery Tab to view the results. Magic!


: RestartCitrixPrintSpoolerOnCrash.bat
@echo off


set SvcRestartCmd=C:\WINDOWS\system32\RestartCitrixPrintSpooler.bat

if _%1_==_/force_ goto :force
if _%1_==_/Force_ goto :force

if exist %SvcRestartCmd% goto :already

goto :begin

:force
echo Forcing script to run

:begin
echo @echo off >%SvcRestartCmd%
echo net stop cpsvc >>%SvcRestartCmd%
echo net stop spooler >>%SvcRestartCmd%
echo net start spooler >>%SvcRestartCmd%
echo net start cpsvc >>%SvcRestartCmd%

sc.exe failure spooler reset= INFINITE actions= run/0/run/0/run/0 command= %SvcRestartCmd%

goto :end

:already
echo Script RestartCitrixPrintSpooler.bat exists already
echo My work is done - exiting
echo use the /Force option to force script to run
:end

1 comment:

  1. Here is Mr Benjamin contact Email details, 247officedept@gmail.com. /  Or Whatsapp +1 989-394-3740 that helped me with loan of 90,000.00 Euros to startup my business and I'm very grateful,It was really hard on me here trying to make a way as a single mother things hasn't be easy with me but with the help of Mr Benjamin put smile on my face as i watch my business growing stronger and expanding as well.I know you may surprise why me putting things like this here but i really have to express my gratitude so anyone seeking for financial help or going through hardship with there business or want to startup business project can see to this and have hope of getting out of the hardship..Thank You.

    ReplyDelete