Purging Print Queues

Microsoft® Windows® 2000 Scripting Guide

microsoft windows 2000 scripting guide

« Previous | Next »   

Purging a print queue provides a fast and easy way to remove all the print jobs from a specified print queue.

For example, if you need to remove a printer from the network, you can purge the print queue and thus delete all the existing print jobs. If you do not, users will assume their documents are still in line to be printed because they will still see them in the print queue. This is because the existence of a logical printer is not dependent on the availability of a physical printer: Removing the physical printer will not also remove the logical printer. Because the logical printer still exists, the print queue, and any documents in it, continue to exist as well.

The IADsPrintQueueOperations interface includes a method, Purge, that can be used to purge print jobs on a printer or group of printers.

Scripting Steps

Listing 13.13 contains a script that purges a print queue. To carry out this task, the script must perform the following steps:

  1. Use a GetObject call to bind to the printer ArtDepartmentPrinter on the print server atl-ps-01.
  2. Use the Purge method to delete all the documents in the print queue.

Listing 13.13   Purging a Print Queue

1 2 
Set objPrinter = GetObject("WinNT://atl-ps-01/ArtDepartmentPrinter") objPrinter.Purge

send us your feedback Send us your feedback « Previous | Next »   


Microsoft Windows 2000 Scripting Guide(c) Automating System Administration 2003
Microsoft Windows 2000 Scripting Guide(c) Automating System Administration 2003
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 635

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net