G
Guest
I am having a problem with installing a printer using a bat file. I run the
bat, all of the keys are created. They look fine. The drivers are then
copied, but then I receive an error: Operation could not be completed. The
specified port is unknown.
Any ideas?
Here is the code.
REG ADD
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard
TCP/IP Port\Ports\HPprinter" /v HostName /t REG_SZ /d HPprinter
REG ADD
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard
TCP/IP Port\Ports\HPprinter" /v HWAddress /t REG_SZ
REG ADD
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard
TCP/IP Port\Ports\HPprinter" /v IPAddress /t REG_SZ /d 172.20.100.150
REG ADD
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard
TCP/IP Port\Ports\HPprinter" /v PortNumber /t REG_DWORD /d 9100
REG ADD
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard
TCP/IP Port\Ports\HPprinter" /v Protocol /t REG_DWORD /d 1
REG ADD
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard
TCP/IP Port\Ports\HPprinter" /v Version /t REG_DWORD /d 1
REG ADD
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard
TCP/IP Port\Ports\HPprinter" /v "SNMP Community" /t REG_SZ /d public
REG ADD
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard
TCP/IP Port\Ports\HPprinter" /v "SNMP Enabled" /t REG_DWORD /d 1
REG ADD
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard
TCP/IP Port\Ports\HPprinter" /v "SNMP Index" /t REG_DWORD /d 1
rundll32 printui.dll,PrintUIEntry /if /b "HPprinter" /f
"c:\WINDOWS\inf\ntprint.inf" /r "HPprinter" /m "HP LaserJet 5000 Series PCL"
bat, all of the keys are created. They look fine. The drivers are then
copied, but then I receive an error: Operation could not be completed. The
specified port is unknown.
Any ideas?
Here is the code.
REG ADD
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard
TCP/IP Port\Ports\HPprinter" /v HostName /t REG_SZ /d HPprinter
REG ADD
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard
TCP/IP Port\Ports\HPprinter" /v HWAddress /t REG_SZ
REG ADD
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard
TCP/IP Port\Ports\HPprinter" /v IPAddress /t REG_SZ /d 172.20.100.150
REG ADD
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard
TCP/IP Port\Ports\HPprinter" /v PortNumber /t REG_DWORD /d 9100
REG ADD
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard
TCP/IP Port\Ports\HPprinter" /v Protocol /t REG_DWORD /d 1
REG ADD
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard
TCP/IP Port\Ports\HPprinter" /v Version /t REG_DWORD /d 1
REG ADD
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard
TCP/IP Port\Ports\HPprinter" /v "SNMP Community" /t REG_SZ /d public
REG ADD
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard
TCP/IP Port\Ports\HPprinter" /v "SNMP Enabled" /t REG_DWORD /d 1
REG ADD
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard
TCP/IP Port\Ports\HPprinter" /v "SNMP Index" /t REG_DWORD /d 1
rundll32 printui.dll,PrintUIEntry /if /b "HPprinter" /f
"c:\WINDOWS\inf\ntprint.inf" /r "HPprinter" /m "HP LaserJet 5000 Series PCL"