If spoolsv is in error state

Yesterday I have explained how to restart spoolsv server (printer spooler) if it exceeds 40MB of memory.
Sometimes spooler service will hang and there will not be high memory consumption, so we would need to detect that problem also. For this scenario I have written following script:
net start | findstr /i Spooler > nul
if not errorlevel 1 goto end
net stop Spooler
sleep 2
net start Spooler
:end
exit

I created schedule task to run this script under system every minute, for 24 hours a day. If spoolsv is OK script will just close, if it is in error state script will restart printer spooler service.

Articulos relacionados

One Response to “If spoolsv is in error state”

  1. 1
    Lionel Schotter Says:

    Hi,

    You mention in the foreword of this post that you explained “yesterday” how to reset the spooler if it exceeds 40MB, does this script do the same thing? Is there a seperate script for that or is there a combined script perhaps?

    Regards

    Lionel

Leave a Reply

Designed by Posicionamiento Web | Copyright by Terminal services log