+ Post New Thread
Results 1 to 1 of 1
Scripts Thread, Print spooler management in Coding and Web Development; This is a script I had to dig out again recently so I thought I'd share it for anyone in ...
  1. #1
    contink's Avatar
    Join Date
    Jul 2006
    South Yorkshire
    Thank Post
    Thanked 327 Times in 233 Posts
    Rep Power

    Post Print spooler management

    This is a script I had to dig out again recently so I thought I'd share it for anyone in a similar position.

    I have a few schools where the teacher sends a really big job that just b*ggers everything up or the spooler dies because of some driver clash (or similar) so again the printers just stop showing up and nobody can print.

    Whatever it is, you obviously don't want the spooler sat there with jobs piling up like a stream of abandoned cars on the M11.

    Enter my script, and how it works is this...

    You have one custom variable "StallTime" which you can define in the script. (The script will assume a stalltime of 20 minutes if you don't set one)

    This is the "line" that the script will use as a measure as to whether a job has stalled and requires action.

    The process works as follows:

    1. Are the Spooler and LPDSVC services are running... If not it will start them
    2. Is the current job older than the stalltime value with a status of "printing"? If yes it stops the services, kicks the first job then restarts the services again.

    It is possible to have the script restart the queue leaving the first job to try again but I found that had unintended consequences with staff submitting huge print jobs being restarted. The fact that they were hogging the printer was irrelevant at the time.

    Now the script just kicks their job off the system if it's still going after (in my case) 10 minutes.

    To use this as an automated script, simply add it to the scheduled tasks and set it to run every 10 minutes. I usually start and stop it at 8:45am and 15:30pm so that staff can print their biiig jobs before or after school (You see I can be nice occassionally)

    Hope this one helps..

    Attached Files Attached Files

+ Post New Thread

Similar Threads

  1. print spooler cleaner util ?
    By mac_shinobi in forum Windows
    Replies: 11
    Last Post: 28th May 2009, 12:07 PM
  2. Print Spooler shut off on print
    By jmair in forum Windows
    Replies: 2
    Last Post: 29th August 2008, 09:35 AM
  3. Print Spooler Nitemare Help Please!!
    By edsa in forum Windows
    Replies: 14
    Last Post: 11th November 2007, 06:24 PM
  4. Print Spooler on Print Server
    By drewinc in forum Windows
    Replies: 8
    Last Post: 22nd May 2007, 10:02 AM
  5. XP Print Spooler
    By Nij.UK in forum Windows
    Replies: 5
    Last Post: 16th May 2006, 11:13 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts