#169129 - 2006-10-13 06:51 PM
Re: Install IP Printers as Admin
|
hieucao
Fresh Scripter
Registered: 2006-08-09
Posts: 18
|
Allen -
We've only 5-6 workstations at remote branches, and we're making changes one branch at a time. We only need to change one laser printer at each remote branch, so this script might not be the most efficient way to installing IP printers, but it'll work. Then, we modified the KIX login script to add the same printer that's shared on the print server when they log into Citrix.
CLS
if not @TSSESSION $ComputerName = SUBSTR(@wksta, 1, 3) Addprinterconnection("\\servername\shared_label_printer1") Addprinterconnection("\\servername\shared_label_printer2") Use I: "\\servername\%username%" Use Q: "\\servername\shared_folder" else $ComputerName = SUBSTR(%CLIENTNAME%, 1,3) Addprinterconnection("\\servername\shared_laser_printer") Addprinterconnection("\\servername\shared_label_printer1") Addprinterconnection("\\servername\shared_label_printer2") SetDefaultPrinter ("\\servername\shared_laser_printer")= 0 endif
Here's the sample printer script that we tested:
reg add "\\TOMCAT01\HKLM\System\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports\TestXPort" /v Protocol /t REG_DWORD /d 0x1
reg add "\\TOMCAT01\HKLM\System\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports\TestXPort" /v Version /t REG_DWORD /d 0x1
reg add "\\TOMCAT01\HKLM\System\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports\TestXPort" /v HostName /t REG_SZ /d ""
reg add "\\TOMCAT01\HKLM\System\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports\TestXPort" /v IPAddress /t REG_SZ /d "192.168.24.37"
reg add "\\TOMCAT01\HKLM\System\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports\TestXPort" /v HWAddress /t REG_SZ /d ""
reg add "\\TOMCAT01\HKLM\System\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports\TestXPort" /v PortNumber /t REG_DWORD /d 0x238c
reg add "\\TOMCAT01\HKLM\System\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports\TestXPort" /v "SNMP Community" /t REG_SZ /d "public"
reg add "\\TOMCAT01\HKLM\System\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports\TestXPort" /v "SNMP Enabled" /t REG_DWORD /d 0x1
reg add "\\TOMCAT01\HKLM\System\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports\TestXPort" /v "SNMP Index" /t REG_DWORD /d 0x1
psservice \\TOMCAT01 stop spooler (utility from www.sysinternals.com)
psservice \\TOMCAT01 start spooler (utility from www.sysinternals.com)
sleep 15 (utility from Win2K Resource Kit) - may need to increase wait time if going over slow WAN link to allow REG ADD to complete and spooler serivce restarted.
rundll32 printui.dll,PrintUIEntry /if /b "Test Printer" /c\\TOMCAT01 /f \\NEWFOCUS\4500\x4500CL6.inf /r "TestXPort" /m "Xerox Phaser 4500N PCL6"
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 293 anonymous users online.
|
|
|