Add Print Model To Comments Field Release Notes
Add Print Model To Comments Field Release Notes
Edition 1, 12 / 2009
Overview Enumerates all the print queues on the server Checks the name of the driver for that queue. If the driver name contains the string HP Universal Printing o Reads the MODEL_NAME from the registry o Outputs a printui.dll command string to concatenate the MODEL_NAME string after any existing comments
Usage
This is a two step process. These steps are designed to be run on the server AFTER queues have been upgraded to UPD. 1. Open a command window. 2. from the command line, on 32 bit systems enter cscript /Nologo AddModelToComments.vbs >doit.bat 2. From the command line, on 64 bit systems enter %windir%\SysWOW64\cscript /Nologo AddModelToComments.vbs >doit.bat This will create a batch file named doit.bat in the current directory. This batch file contains all the commands to write the device name to the comments field. 3. The user is advised to open the batch file and inspect it to verify that it will do what is intended on the intended printers. If there are printers on this list that you do not want modified, simply delete those lines from the batch file. 4. Run the batch file doit.bat from the command prompt
Command Line: AddModelToComments [-l?] [-s server] Arguments: -l - put model in location field instead of comments field -r - replace contents instead of concatenate -s - cluster or remote server name -v - verbose mode - list all printers and drivers found -x - execute now instead of creating batch file -? - display command usage Example: AddModelToComments -l -r -s server_name
rundll32 printui.dll,PrintUIEntry /Xs /n "HP CLJ 3800 upstairs" comment "ArtDepartment HP Color LaserJet 3800"
The batch file runs the printui.dll once for each one of the printers. In this example, the comments field originally contained the string ArtDepartment for this one printer. After doit.bat runs the comments field will be ArtDepartment HP Color LaserJet 3800"
Limitations
The script in its current form will concatenate the device model string to whatever string is currently in the comments field. This may be a concern for the following reasons: If the script is run more than once, then the device model will be appended more than once. There are no checks in the script regarding string length. If the comments field is excessively long to begin with, the device model may be truncated or an error may result.