Writing and scheduling a script to stop and then restart print spooler

Posted on 2004-10-21
Last Modified: 2012-06-22
I am running terminal services on a Windows 2000 server SP4.  Every so often the spooler stops allowing users the ability to delete jobs stuck in the print queue.  An administrator must log in, stop and then restart the spooler service to clear print jobs already deleted in the queue.

Can anyone tell me how to setup and schedule a script that will stop and restart the print spooler (as an administrator) every 4 to 6 hours?

Question by:orther
    LVL 6

    Assisted Solution

    Another expert has addressed this:

    You'll want to set options in the Advanced button in the Schedule tab of your Scheduled Tasks
    LVL 76

    Accepted Solution

    Seems pretty simple.  Create a command file containing the following commands:

    net stop spooler
    net start spooler

    Now create a scheduled job that runs the command file however often you want.  Set the job up under an account with admin rights.  Voila.
    LVL 5

    Expert Comment

    You can even set the spooler to restart itself.  Its in the services properties.  What you really need to look at is the root of the problem.  Terminal services and Citrix can be very finicky about printing.  There are a few things you want to avoid.  Cheap printers, especially deskjet/inkjets.  Avoid auto printer creation whenver you can.  Also make sure all of your print drivers are current.  If you are printing to a bic copy/fax/scanner/email/espresso/food processor type machine, they often times you LPR.  I had this same problem and corrected it by installing print services from UNIX.

    Author Comment

    I actually tried both of these answers and they worked for me.  I finally just created a batch file to do the net stop spooler and net start spooler and scheduled them to run using Scheduler.  

    Scheduler can be found by selecting Start, Programs, Accessories, System Tools, then Scheduled Tasks.  Follow the wizard and you should be good to go!

    Thanks for your help.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
    Know what services you can and cannot, should and should not combine on your server.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    931 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now