Installing IPP Printers Two Ways

Novell Cool Solutions: Trench
By Guy Sasson

Digg This - Slashdot This

Posted: 4 Aug 2004

In our company to install printers we use web pages based on iPrint showing floor plans and printer location. We found that we cannot insert selected drivers to the NDPS Broker. Here are two ways around that.

There are two ways to install ipp printers, either using a batch file or a web browser.

Batch File Method

Here is how to install ipp printers using a batch file. The command is:

rundll32 printui.dll,PrintUIEntry /b " DisplayPrinterName" /x /n "printer name" /if /f " 
\\Server\Volume\Tektronics phaser 360p\win2k-xp\win2kms.INF" /r "printer ipp URL" /m "printer driver model name"

For more details you can type
rundll32 printui.dll,PrintUIEntry /?

The /x switch is not documented with /?. The /x flag treats the install as a Web point and print. This flag indicates that the printer is a masquerading (masq) printer. A masq printer is partly local printer and partly a network printer. A masq printer receives rich notifications from the remote print server. Without the /x option, the printer is a local printer with a redirected port.

The /m switch is the printer driver model name as you can find inside the inf file you indicate in the /f switch.

Example for Batch file:

rundll32 printui.dll,PrintUIEntry /b "Test Printer" /x /n "BuildingC_F1_Tektronix on ipp://Printing.elisra.Com" 
/if /f " \\Server\Volume\Tektronics phaser 360p\win2k-xp\win2kms.INF" /r
 "ipp://Printing.Company.Com/ipp/BuildingC_F1_Tami_Tektronix" /m "Tektronix Phaser 360 Extended"

## This file must run from the directoy of the driver, otherwise the user might be prompted for file location.

Web Browser Method

Here is how to install an ipp printer using a web browser. As I mentioned, we use iPrint to install all our printers, so we needed a solution using a web browser. The following is an ASP web file that does the installation:

Example for install.asp file:

<%@ Language=VBScript %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
<script language=vbscript>

Sub RunProgram(P_Name)
Dim WshSHell
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run P_Name, 3, false
Set WshShell = Nothing
End Sub
sub xyz()
s = "rundll32 printui.dll,PrintUIEntry /b " + chr(34) + "<%=Request.QueryString("p1")%>" + chr(34)
s = s + " /x /n " + chr(34) + "<%=Request.QueryString("p2")%>" + chr(34)
s = s + " /if /f " + chr(34) + "<%=Request.QueryString("p3")%>" + chr(34)
s = s + " /r " + chr(34) + "<%=Request.QueryString("p4")%>" + chr(34)
s = s + " /m " + chr(34) + "<%=Request.QueryString("p5")%>" + chr(34)

s = " " + chr(34) + "<%=Request.QueryString("p1")%>" + chr(34)
s = s + " " + chr(34) + "<%=Request.QueryString("p2")%>" + chr(34)
s = s + " " + chr(34) + "<%=Request.QueryString("p3")%>" + chr(34)
s = s + " " + chr(34) + "<%=Request.QueryString("p4")%>" + chr(34)
s = s + " " + chr(34) + "<%=Request.QueryString("p5")%>" + chr(34)

'msgbox s
RunProgram "c:\install.bat" + s
end sub
Sub createInstallFile(s)
Dim fso
Dim ts
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.CreateTextFile("c:\install.bat", True)
ts.WriteLine "cd " + Mid(s, 1, InStrRev(s, "\") - 1) 
ts.WriteLine Left(s, 2)
ts.WriteLine "rundll32 printui.dll,PrintUIEntry /b %1 /x /n %2 /if /f %3 /r %4 /m %5"
Set fso = Nothing
Set ts = Nothing
End Sub
<body MS_POSITIONING="GridLayout" onload=xyz>

<form id="Form1" method="post" runat="server">



You will need to insert the above file into a web server that supports ASP files (IIS).

Next you need to open this page from a browser:

Where xyz=printer name
ccc=path to INF file (v:\HP4000\file.inf)
ttt=port (ipp://Printing.Company.com/ipp/printer_object_name)
eee= printer driver model name as you can find inside the inf

The above code creates a file in the root of drive c:\ called install.bat and executes the file.

If you have any questions you may contact Guy at guys@elisra.com

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

© Micro Focus