Author: NetworkAdminKB.com

Created: 2009-11-30

Modified: 2009-12-02

 

Version 1.1

This utility can be used to rename user printers given several different factors.  It is useful in Citrix Metaframe / Presentation Server / Terminal Server environments where auto created printers names need to be managed for ease of use or because some applications have length limits on printer names.

 

Requirements and Limitations

1)      VB6 Runtime may be required on Windows 2000 or earlier OS.

2)      Security access to WMI and to manage printers is required.  By default management of printers requires Power User access.

3)      Tested and developed on Windows XP for Windows 2003.

 

Syntax

RenamePrinters

             /p[=text] /s[=text] [/id] [/e=ExcludeFile] [/l]

 

Purpose:    Rename printers in the following format.

              prefix-suffix.[id].#

 

Select desired combination of /p, /s, /id

/p[=text]   Specifies the desired prefix, or uses '%USERNAME%-' as default.

/s[=text]   Specifies the desired suffix, or uses 'Printer.' as default.

/id         Include the Session ID of a Terminal Server environment in printer

              name.

/sn         Save current printer name to printer comment.

/e=ExcludeFile Specify a file containing a list of Printer Names to

                 exclude. (One Printer Name per line.)

/l          List the current installed printers.

 

Exmamples:

  RenamePrinters /p /s                        Results in: Username-Printer.#

  RenamePrinters /p /s /id                    Results in: Username-Printer.ID.#

  RenamePrinters /s=CTXPrinter /id            Results in: CTXPrinter.ID.#

  RenamePrinters /p=PTR- /s=%USERNAME%. /id   Results in: PTR-Username.ID.#

  RenamePrinters /l                           Lists installed printers

 

Notes

1)      The user default printer is always assigned the suffix “Default.”. 

2)      The /sn option allows users to identify printers by their old names as well.

3)      Misspelled or incorrect printers in the Exclude file are ignored.

4)      The Exclude file is not case sensitive

5)      The # in the name relates to the order in which the printers were processed.  This may change on every logon, over time, etc, and is used to provide uniqueness to the name.

6)      The /id option is needed on Terminal Servers to give a unique name per user session.

 

Example

renameprinters /e=exclude.txt /s=AutoPRT. /sn

 

exclude.txt

Microsoft Office Document Image Writer

WebEx Document Loader

PDF995

Adobe PDF

 

Download RenamePrinters

Article ID: 219, Created On: 9/18/2011, Modified: 9/29/2011