Pausing Printers

Microsoft® Windows® 2000 Scripting Guide

microsoft windows 2000 scripting guide

« Previous | Next »   

Physical printers and logical printers are not irrevocably tied to one another. If you turn off the physical printer, this will not affect the logical printer in any way. Instead, the logical printer will still appear to be functioning, even though the physical printer is no longer available.

Among other things, this means that anytime a physical printer is removed from the network (for example, to undergo routine maintenance), the logical printer representing that device should be paused. If the physical printer is removed from the network and the logical printer is not paused, the print server will periodically attempt to print the first job in the print queue, even though the printer is no longer available. As a result, the print server uses up processing power in an attempt to complete a task that cannot be completed. When the logical printer is paused, print jobs simply remain in the queue, and no attempt is made to print them until the logical printer is resumed.

Logical printers can be paused by using the Pause method of the IADsPrintQueueOperations interface.

Scripting Steps

Listing 13.11 contains a script that pauses a printer. 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 Pause method to pause the printer.

Listing 13.11   Pausing a Single Printer

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

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