[THIN] Re: OT: Print driver scripted install

  • From: "Lich, Brian M" <blich@xxxxxxxxx>
  • To: <thin@xxxxxxxxxxxxx>
  • Date: Mon, 28 Feb 2005 17:33:43 -0500

You could add the VB script below to a package with the driver files and
point the last two lines of this script to the package.

 

What I did was create an IP printer and then exported
HKLM\System\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP
Port\Ports\IP_192.168.1.1.  These registry keys will create the TCP/IP
port.  After that, you have to restart the print spooler service so that
the port is accessible.  Finally, you execute the last two lines to
actually create the printer and set it as default
(http://support.microsoft.com/kb/q189105/).

 

Set oShell = CreateObject("Wscript.Shell")

 

oShell.RegWrite
"HKLM\System\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP
Port\Ports\IP_192.168.1.1\Protocol", 1, "REG_DWORD"

oShell.RegWrite
"HKLM\System\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP
Port\Ports\IP_192.168.1.1\Version", 1, "REG_DWORD"

oShell.RegWrite
"HKLM\System\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP
Port\Ports\IP_192.168.1.1\HostName", "192.168.1.1", "REG_SZ"

oShell.RegWrite
"HKLM\System\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP
Port\Ports\IP_192.168.1.1\IPAddress", "192.168.1.1", "REG_SZ"

oShell.RegWrite
"HKLM\System\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP
Port\Ports\IP_192.168.1.1\HWAddress", "", "REG_SZ"

oShell.RegWrite
"HKLM\System\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP
Port\Ports\IP_192.168.1.1\PortNumber", &H0000238c, "REG_DWORD"

oShell.RegWrite
"HKLM\System\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP
Port\Ports\IP_192.168.1.1\SNMP Community", "public", "REG_SZ"

oShell.RegWrite
"HKLM\System\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP
Port\Ports\IP_192.168.1.1\SNMP Enabled", 1, "REG_DWORD"

oShell.RegWrite
"HKLM\System\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP
Port\Ports\IP_192.168.1.1\SNMP Index", 1, "REG_DWORD"

 

oShell.run "net stop spooler", 0, TRUE

wscript.sleep 5000

oShell.run "net start spooler", 0, TRUE

 

oShell.run "rundll32 printui.dll,PrintUIEntry /if /b " & chr(34) & "HP
LaserJet 9050 PCL 6" & chr(34) & " /f " & chr(34) &
"\\server\Printer\hp\lj9050\hpc9050c.inf" & chr(34) & " /r " & chr(34) &
"IP_192.168.1.1" & chr(34) & " /m " & chr(34) & "HP LaserJet 9050 PCL 6"
& chr(34) & " /z /u",1,TRUE

oShell.run "rundll32 printui.dll,PrintUIEntry /y /n " & chr(34) & "HP
LaserJet 9050 PCL 6" & chr(34),TRUE

 

Hope this helps...

Brian Lich

 

  _____  

From: thin-bounce@xxxxxxxxxxxxx [mailto:thin-bounce@xxxxxxxxxxxxx] On
Behalf Of Matthew Shrewsbury
Sent: Monday, February 28, 2005 5:09 PM
To: thin@xxxxxxxxxxxxx
Subject: [THIN] OT: Print driver scripted install

 

In the never ending saga of doing more with less I have a number of
sites that have no print servers (actually no severs at all). They us
Citrix entirely for all their needs including printing to IP printers.
However without a Windows print server it is a real pain when you need
to add another printer. 

 

Does anyone know of a way to create scripted install packages for print
drivers on Windows 2000 and XP? The script would need to setup the IP
based printing using Windows IP printing. 

 

Ideally I'd have the user point there web browser to an Intranet website
and download a package that would include the driver and the scripted
install of the driver. Thanks for any suggestions.

 

Matthew Shrewsbury, MCSE+Internet MCSE 2000 CCA Server+

Network Administrator

 

Other related posts: