Novell is now a part of Micro Focus

Installing iPrint Printers via a Batch File and ZENworks

Novell Cool Solutions: Trench
By Adam Reno

Digg This - Slashdot This

Posted: 4 Feb 2005

This is an update to another article I read on the ZENworks Cool Solutions Site that got me started. That article was for NDPS Printers.

Here's how to install iPrint printers via a batch file automatically, save the printer driver settings to a file, and put the driver settings back into the printer. (Just run a batch file from ZENworks!)

Saving Printer Settings to a file:

  1. Install the Printer
  2. Run this command:
    RUNDLL32 PRINTUI.DLL,PrintUIEntry /Ss /n "NDPSPrintername on ipp://serveripaddress" /a "settings.bin" d u g 2
    (Just Change the Name of the NDPSPrintername to match whatever your printer says in XP's Printers and Faxes folder.. for example "\\ipp://10.x.x.x\MIS-LJ4-1")
    - Make sure you include the *d u g 2* at the end of the command in order to pick up on ALL the relevant printer settings.

Install an iPrint Printer

1.Run the following command:

rundll32 printui.dll,PrintUIEntry /b "iPrint Printer Name" /x /n "Nevermind This" /if /f %windir%\inf\ntprint.inf /r "ipp://10.x.x.x/ipp/MIS-LJ4100-1" /m "HP LaserJet 5Si MX"

This is the most complicated. Let's break it down a little bit.

rundll32 printui.dll,PrintUIEntry /b --- DO NOT CHANGE

"iPrint Printer Name" --- Call it whatever you want. If you want to preserve the typical iPrint long names call it *Printername on ipp://serveripaddress* I found that you can call it anything and it still works: *Printername* or *Bob* works just fine

/x /n * The secret of installing an iPrint Printer* this is vital

"Nevermind This" --- in order to use the /x switch you have to put the /n switch in. Apparently the /n does nothing at this point and you can put whatever you want in the quotes without it effecting the outcome of the install. One of those odd programming quirks I guess.

/if /f -- /if is *Install printer using an inf file* /f is telling the string that the inf file is next in the list.

%windir%\inf\ntprint.inf --- Yuk Drivers. If your OS has the driver for the printer ALREADY INSTALLED you can use this line as it is. Otherwise you*ll download the driver and reference it here* an example of would be f:\public\drivers\LJ2100\hp211ip5.inf. If you have referenced the command from a batch file, you need to change to the directory where the driver resides before running the command, otherwise it will prompt you to *Insert a disk* or *Browse for a location*. Change to the directory in a batch file by using *f:* then *cd \* then *cd \some\directory\location\*

/r "ipp://10.x.x.x/ipp/MIS-LJ4100-1" --- The /r is port. You can tell if you got this right.if you change the ipp:// to a http:// and put it in the browser. *http://serveripaddress/ipp/ndpsprintername* Your browser should return some information about your printer and NOT say *Unknown Printer*

/m "HP LaserJet 5Si MX" --- The /m stands for *Model* and the *HP LaserJet 5Si MX* is for the EXACT name of the printer driver as shown under the printers *Advanced* tab. If you are using a printer driver that the OS does not already have in installed, read thought the printers inf file to figure out what the printer driver name is.

Restoring Driver Settings to the iPrint Printer

Once you have the .bin file for the printer, you can put the trays, configurations, and settings back into the printer by running the following command:

RUNDLL32 PRINTUI.DLL,PrintUIEntry /Sr /n "NDPSPrintername" /a "settings.bin" d u g 2

Again, the *NDPSPrintername* is the name of the printer as it is seen from the Printers and Faxes folder in XP. It could be the long name for the iPrint printer, such as *Someprinter on ipp://servername/*

Again, make sure to keep the *d u g 2* on the end of the command to keep all the settings.

When saving and restoring bin files, it's ok to put a path in front of the .bin file (example *c:\settings\printer1.bin*)


Here are some examples for you to ponder:

Install the Printer when the driver is already on the OS:
rem rundll32 printui.dll,PrintUIEntry /b "MIS-LJ4100-1 on ipp://10.x.x.x" /x /n "Nevermind This" /if /f %windir%\inf\ntprint.inf /r "ipp://10.x.x.x/ipp/MIS-LJ4100-1" /m "HP LaserJet 5Si MX"

Install the Printer when the driver is NOT on the OS
rundll32 printui.dll,PrintUIEntry /b "LEGAL-IMGC350C-1" /x /n "Nevermind This" /if /f C:\lsetup\Drivers\img350\OEMSETUP.INF /r "ipp://10.x.x.x/ipp/LEGAL-IMGC350C-1" /m "KONICA MINOLTA C350 PCL5c"

Store the Printer Settings: (Printer Must Be Installed)
RUNDLL32 PRINTUI.DLL,PrintUIEntry /Ss /n "LEGAL-LJ4100-4" /a "4100-4.bin" d u g 2

Put the settings back: (Printer Must Be Installed)
RUNDLL32 PRINTUI.DLL,PrintUIEntry /Sr /n "LEGAL-LJ4100-4" /a "4100-4.bin" d u g 2

If you have any questions you may contact Adam at

Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions.

© Copyright Micro Focus or one of its affiliates