3. Printing Process
1. User prints from app
2. App contacts GDI (Graphical Device Interface)
3. GDI contacts print driver for printer info,
renders (combines printer info & document)
4. GDI sends rendered job to the print spooler
5. Client side spooler contacts server side
spooler
6. Server side spooler contacts print router
Eric Vanderburg Š 2006
4. 7.
Print router determines if the printer is local or remote.
a.
b.
Local: job forwarded to local print provider
Remote: finds remote print provider for that print server & that
print provider sends the data to the print server local print
provider
7.
Local print provider finds a print processor that can
process the print job
8. Print processor contacts GDI for further rendering (if
required)
9. Print processor sends job to separator processor
10. Job is sent to the port monitor which is connected to
the printer.
Eric Vanderburg Š 2006
5. Concepts
⢠Changing spool directory
â Printers & Faxes
â File ď¨ Server Properties ď¨ Advanced tab
â Type a new location
â See pg. 321
Eric Vanderburg Š 2006
9. Scripting
â˘
Prncnfg.vbs â printer configuration
â -g : Required. Specifies that you want to display configuration
information about a printer.
â -t : Required. Specifies that you want to configure a printer.
â -s RemoteComputer : Specifies, by name, the remote computer that
manages the printer about which you want to display information. If you
do not specify a computer, the local computer is used.
â -p PrinterName : Required. Specifies, by name, the printer about which
you want to display information.
â -u UserName -w Password : Specifies an account with permissions to
connect by using Windows Management Instrumentation (WMI) services
â -l Location : Specifies the printer location, such as "Copier Room."
â -m Comment : Specifies the comment string.
â -h ShareName : Specifies the share name.
â -f SeparatorText : Specifies a file that contains the text that appears on
the separator page.
â To keep spooled jobs after printing:  cscript prncnfg.vbs -t -s RootÂ
-p TheBeast +keepprintedjobs
Eric Vanderburg Š 2006
10. Scripting
â˘
â˘
â˘
â˘
â˘
â˘
â˘
â˘
â˘
{+ | -}shared :
{+ | -}direct : Specifies whether the document should be sent directly to the
printer without being spooled.
{+ | -}published :Â
{+ | -}rawonly : Specifies whether only raw data print jobs can be spooled
on this queue.
{+ | -}queued : Specifies that the printer should not begin to print until after
the last page of the document is spooled.
{+ | -}keepprintedjobs : Specifies whether the spooler should retain
documents after they are printed. Enabling this option allows a user to
resubmit a document to the printer from the print queue instead of from the
printing program.
{+ | -}workoffline : Specifies whether you should be able to send print jobs
to the print queue even if your computer is not connected to the network.
{+ | -}enabledevq : Specifies whether print jobs that do not match the
printer setup (for example, PostScript files spooled to non-PostScript
printers) should be held in the queue rather than being printed.
{+ | -}docompletefirst : {+ | -}enablebidi : Specifies whether the printer
sends status information to the spooler.
Eric Vanderburg Š 2006
11. Scripting
⢠Prndrvr.vbs
â -a : Specifies that you want to install a driver.
â -d : Specifies that you want to delete a driver.
â -m DriverName : Specifies, by name, the driver you
want to install. Drivers are often named for the model
of printer they support. See the printer documentation
for more information.
â -v {0 | 1 | 2 | 3} : Specifies the version of the driver
you want to install. (0=9x, 1=NT3, 2=NT4, 3=2k/XP)
â -e Environment (x86, Alpha, R4000, PowerPC)
â cscript prndrvr.vbs -a -m "Color Printer Driver 1"Â
-v 3 -e "Windows NT x86"
Eric Vanderburg Š 2006
12. Scripting
⢠Prnport.vbs â change ports
â -a : Required. Specifies that you want to create a standard
TCP/IP printer port.
â -r PortName : Required. Specifies the port to which the printer is
connected.
â -s RemoteComputer :Â
â -h IPAddress : Required. Specifies the IP address you want to
assign to the port.
â -u UserName -w Password :Â
â -o {raw -n PortNumber | lpr} : Specifies which protocol the port
uses: TCP raw or TCP LPR. If you use TCP raw, specifies the
port number for a TCP raw printer port. (Default port is 9100)
â -q QueueName : Specifies the queue name for a TCP raw port.
â cscript prnport.vbs -t -r PortName -s Root -o raw -n 8521
-h 192.168.0.10 -q NtQueue -i Index1 -u evanderburg w OrangeJuice
â To list all printer ports:  cscript prnport.vbs -l -s Root
Eric Vanderburg Š 2006
13. Scripting
⢠Prnmngr.vbs â set default printer, add printer connection
â
â
â
â
-a : Required. Specifies that you want to add a local printer.
-x : Required. Specifies that you want to delete all printers. Â
-s RemoteComputer :Â
-p PrinterName : Required. Specifies, by name, the local printer
that you want to add.
â -m DriverName : Required. Specifies, by name, the driver for
the local printer you want to add. Drivers are often named for the
model of printer they support. See the printer documentation for
more information.
â -r PortName : Required. Specifies the port to which the printer is
connected. If this is a parallel or a serial port, use the ID of the
port (for example, LPT1 or COM1). If this is a TCP/IP port, use
the port name that was specified when the port was added.
-u UserName -w Password :
â cscript prnmngr.vbs -x -s Root -p TheBeast -u evanderburg w OrangeJuice
Eric Vanderburg Š 2006
14. Scripting
⢠Prnjobs.vbs â view, pause, cancel jobs
â
â
â
â
â
â
â
â
-z : Required. Specifies that you want to pause a print job.
-x : Required. Specifies that you want to cancel a print job.
-s RemoteComputer :Â
-p PrinterName : Required. Specifies, by name, the printer that
would print the job you want to pause.
-j JobNumber : Required. Specifies, by ID number, the print job
you want to pause.
-u UserName -w PasswordÂ
cscript prnjobs -x -s Root -p TheBeast  -j JobNumberÂ
-u evanderburg -w OrangeJuice
List current print jobs:  cscript prnjobs.vbs -l -p Printer2
Eric Vanderburg Š 2006
15. Scripting
⢠Prnqctl.vbs â pause, cancel, resume jobs, test
page print
â -x : Required. Specifies that you want to cancel all
jobs spooled to a printer.
â -z : Required. Specifies that you want to pause
printing.
â -s RemoteComputer :Â
â -p PrinterName : Required. Specifies, by name, the
printer you want to pause.
â -u UserName -w Password :
â cscript prnqctl.vbs -x -s Root -p TheBeast
-u evanderburg -w OrangeJuice
⢠To run: cscript name.vbs parameters
Eric Vanderburg Š 2006
16. Acronyms
⢠GDI, Graphics Device Interface
⢠IPP, Internet Printing Protocol
⢠WSH, Windows Scripting Host
Eric Vanderburg Š 2006