unc machine name if the action is on a remote machine
/dl
delete local printer
/dn
delete network printer connection
/dd
delete printer driver
/e
display printing preferences
/f[file]
either inf file or output file
/ga
add per machine printer connections
/ge
enum per machine printer connections
/gd
delete per machine printer connections
/h[arch]
driver architecture, one of the following:
Alpha | Intel | Mips | PowerPC
/ia
install printer driver using inf file
/id
install printer driver using add printer driver wizard
/if
install printer using inf file
/ii
install printer using add printer wizard with an inf file
/il
install printer using add printer wizard
/in
add network printer connection
/j[provider]
print provider name
/k
print test page to specified printer, cannot be combined with command when installing a printer
/l[path]
printer driver source path
/m[model]
printer driver model name
/n[name]
printer name
/o
display printer queue view
/p
display printer properties
/q
quiet mode, do not display error messages
/r[port]
port name
/s
display server properties
/Ss
Store printer settings into a file
/Sr
Restore printer settings from a file
Store or restore printer settings option flags that must be placed at the end of command:
2
PRINTER_INFO_2
7
PRINTER_INFO_7
c
Color Profile
d
PrinterData
s
Security descriptor
g
Global DevMode
m
Minimal settings
u
User DevMode
r
Resolve name conflicts
f
Force name
p
Resolve port
/u
use the existing printer driver if it's already installed
/t[#]
zero based index page to start on
/v[version]
driver version, one of the following:
Windows 95 or 98 | Windows NT 3.1 | Windows NT 3.5 or 3.51 | Windows NT 3.51 | Windows NT 4.0 | Windows NT 4.0 or 2000 | Windows 2000
/w
prompt the user for a driver if specified driver is not found in the inf
/y
set printer as the default
/Xg
get printer settings
/Xs
set printer settings
/z
do not auto share this printer
/Z
share this printer, can only be used with the /if option
adding comments and location fields to the printer!
Also, I might add: when you're using the /Z switch to auto-share a printer,
it truncates the name to 8 characters. By using the syntax included on this
webpage, you can change the share to be longer than 8. This command is
especially useful, since it's cluster-aware.
Sometimes we need to do just alittle more than RUNDLL32 is capable of,
like installing a TCP/IP printer port.
In that case, consider buying yourself a copy of the
Windows 2000 Server/Windows Server 2003
Resource Kit and use PRNADMIN.DLL and the accompanying sample
scripts written in VBScript.
My own AddIPPrn.bat
uses these VBScripts to install a printer, its driver and a TCP/IP printer
port on a remote computer.
If all you need is to backup/restore, clone or migrate existing printers:
Often the printer configurations of existing computers need to be
cloned to other computers, or restored after reinstalling Windows.
In those cases, a backup/export and restore/import with Microsoft's
PrintMig
3.1 may be the best (and easiest) solution.
Though earlier versions of PrintMig were GUI only, version 3.1 can also be
run without user interaction from the command line or in a batch file:
Microsoft (R) Windows (TM) Printer Migrator 3.1
Copyright (C) 1997-2002 Microsoft Corp. All rights reserved
usage: PRINTMIG [options] [server]
[-?] Display this message
[-b] Backup - followed by CAB file name
[-r] Restore - followed by CAB file name
[-l] Attempt to convert LPR Ports to SPM
[-i] Suppress warning popups. Info still written to log file.
If server is not specified then the local machine is implied.
Example command line to restore an existing config to a server:
printmig -r d:\print\ps1.cab \\prt-srvr1
Example command line to backup a server to the specified file:
printmig -b "\\filesrv\store\print server 2.cab" \\prt-srvr2