Setting up network printer in Windows 7

IYIaster

Banned
Local time
6:41 PM
Messages
20
I'm trying to setup a network printer in Windows 7 from command line. I've tried using the rundll32 printui.dll command. It works in Windows XP. But pops up with an error "The specified port is unknown" in Windows 7.
 

My Computer

OS
Windows 7
Go to Control Panel\Hardware and Sound\Devices and Printers > Add a Printer > Add a network, wireless or Bluetooth printer
 

My Computer

Computer Manufacturer/Model Number
HP, Dell, Gateway, Toshiba - 4 laptops and 2 desktops
OS
Vista, Windows7, Mint Mate, Zorin, Windows 8
CPU
from 1.6GHz Duo to i7
Monitor(s) Displays
2x HP w2207
Hard Drives
5x HDD, 7x SSD, 12x Externals
Keyboard
with trackball - no mices
Mouse
Trackball mice
Internet Speed
DSL 6000
rundll32 printui.dll,PrintUIEntry is the correct command

or you can use the command line util:

PRINTUI
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell OP7010
OS
Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
Memory
16GB
Monitor(s) Displays
4 Dell 24" LCD
Screen Resolution
1280x1024
Keyboard
Dell
Mouse
Dell Optical
Internet Speed
40meg
To install my wireless printer I did what whs suggested. But first you need to install the stuff on the cd that came with your printer. Follow on-screen instructions once you've loaded up the cd.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
The Dominator?
OS
Windows Seven Ultimate
CPU
AMD Piledriver FX 8320 @ 3.5GHz
Motherboard
ASUS M5A97 EVO R2.0
Memory
Crucial Ballistix 8GB 1600 MHz DDR3
Graphics Card(s)
ASUS GeForce GTX 970 Strix Edition @ 1.114 GHz
Sound Card
Integrated
Monitor(s) Displays
LG 23EA63V 23" IPS 1080p Monitor
Screen Resolution
1920x1080
Hard Drives
Samsung SSD 840 EVO 120 GB
1x WD GreenPower 500GB 7200RPM
1 External HDD 1TB
PSU
Corsair CX500
Case
Zalman Z9 Plus
Cooling
CPU - Corsair Hydro H80i, Case - 3x Aerocool Shark Edition
Keyboard
Xenta Backlit Keyboard (Not very good!)
Mouse
Logitech G400
Internet Speed
Download: 7 mb/s Upload: 0.76 mb/s
Antivirus
Microsoft Security Essentials
Browser
Google Chrome
Other Info
Overclockers UK Desk Pad 89 x 45 cm
1200x730x600mm Desk
Using Virtual Audio Cable to split stereo sound into Audio Technica ATH-M50 headphones and Logitech X-530 speakers.
why dont u add a network printer like u usually do in windows? just add a local printer on the port tcp/ip and add in your IP.
 

My Computer

Computer Manufacturer/Model Number
Windows 7 Ultimate 64-bit
OS
Windows 7 Ultimate N 64-bit
CPU
AMD Black Edition - AMD Phenom X4 2.5 GHz Processor
Motherboard
Bio Star
Memory
8GB DDR2 800MHZ BRANDED
Graphics Card(s)
Palti NVIDIA GeForce GTX 460
Monitor(s) Displays
3D 23.6" & 22"
Screen Resolution
1920x1080@120Hz
Hard Drives
313GB SAMSUNG SAMSUNG HD321KJ
PSU
OCZ 600W StealthXStream PSU, PowerWhisper, Active PFC
Internet Speed
22793
why dont u add a network printer like u usually do in windows? just add a local printer on the port tcp/ip and add in your IP.

Because we set up alot of printers everyday. We usually have to setup 2 or more printers for each PC & say there are 20 + PCs at one store. Then we have to go thru that process 40+ times. I created a little java web applet that allows you to just type in the printer name & the IP address & hit install. This will save us alot of time. This applet works fine in Windows XP. But, not in Windows 7.

printersetup.tk

After doing some research I think you have to add the port to the registry in Windows 7 before you can install a TCP I/P printer from command line. I tried this command but still comes up as "Unknown Port"

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 4100 Series PCL6"
 

My Computer

OS
Windows 7
Really no one has any idea how to setup a tcp / ip printer in windows 7 from command line?
 

My Computer

OS
Windows 7

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
self build
OS
win 7 ultimate32bit, Win8.1pro wmc 32bit
CPU
amd phenom x4 9600
Motherboard
asus m2n32-sli deluxe
Memory
corsair twinxs 2x2gb
Graphics Card(s)
2x nvidia 1gb 8500gt
Sound Card
onboard
Monitor(s) Displays
23" PB Viseo 233d
Screen Resolution
1920x1080
Hard Drives
maxtor sata 500gb
maxtor sata 320gb
fujitsu sata200gb
PSU
oryxx tornado 750w
Case
thermaltake xaser lll
Cooling
artic freezer64 pro + 7 case fans

My Computer

OS
Windows 7

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell OP7010
OS
Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
Memory
16GB
Monitor(s) Displays
4 Dell 24" LCD
Screen Resolution
1280x1024
Keyboard
Dell
Mouse
Dell Optical
Internet Speed
40meg
I wrote this script (VBScript) a long time ago for adding a printer to Windows XP machines. I tested it and it works on Windows 7. I tweaked it a bit to take the bare minimum input. The biggest problem with it is that you have to know the EXACT name of the driver or the script will fail. If you know all this information and know it well then the script will help you add 2 or 3 printers quickly.

Example use:

Printer Name: HP LaserJet 4500N
Printer Driver Name: HP LaserJet 4500 series PCL6
Port Name: 192.168.1.200

You must have the Printer Driver Name exactly correct or it will fail. If the IP address is wrong or the computer cannot access the IP address this script will fail.

Please NOTE there is no error checking.

If you have the printer shared off a server there is a much better way of doing this and I have a different script for that let me know.

Here it is: (Copy and paste in Notepad, save as "AddPrinter.vbs") or Download below.

Code:
' Add Local Printer v2.1
' Programmed by WindowsStar - Copyright (c) 2008-2010
' ---------------------------------------------------
On Error Resume Next
Set WShNetwork = CreateObject("WScript.Network")
Set WShShell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Set objEnv = WshShell.Environment("Process")
Title = "Printer Name"
Message = "Name of Printer." & vbLF & vbLF & "Leave blank or press cancel to quit."
strPrinter = InputBox(Message, Title)
If strPrinter = "" Then Wscript.quit
Title = "Printer Driver Name"
Message = "Printer Driver Name." & vbLF & vbLF & "Leave blank or press cancel to quit."
strDriverName = InputBox(Message, Title)
If strDriverName = "" Then Wscript.quit
Title = "Port Name"
Message = "Enter the port you want to use." & vbLF & vbLF & "Enter and IP address (i.e. 192.168.1.1)" & vbLF &  "OR Enter LPT1: for parallel printing." & vbLF & vbLF & "Leave blank or press cancel to quit."
strPort = InputBox(Message, Title)
If strPort = "" Then Wscript.quit
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objPrinter = objWMIService.Get("Win32_Printer").SpawnInstance_
objPrinter.DriverName = strDriverName
objPrinter.PortName   = strPort
objPrinter.DeviceID   = strPrinter
objPrinter.Location = ""
objPrinter.Network = False
objPrinter.Shared = False
objPrinter.ShareName = ""
objPrinter.Put_
WshShell.Popup "          Done!",5,"Script Message"
 

Attachments

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell OP7010
OS
Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
Memory
16GB
Monitor(s) Displays
4 Dell 24" LCD
Screen Resolution
1280x1024
Keyboard
Dell
Mouse
Dell Optical
Internet Speed
40meg
I wrote this script (VBScript) a long time ago for adding a printer to Windows XP machines. I tested it and it works on Windows 7. I tweaked it a bit to take the bare minimum input. The biggest problem with it is that you have to know the EXACT name of the driver or the script will fail. If you know all this information and know it well then the script will help you add 2 or 3 printers quickly.

Example use:

Printer Name: HP LaserJet 4500N
Printer Driver Name: HP LaserJet 4500 series PCL6
Port Name: 192.168.1.200

You must have the Printer Driver Name exactly correct or it will fail. If the IP address is wrong or the computer cannot access the IP address this script will fail.

Please NOTE there is no error checking.

If you have the printer shared off a server there is a much better way of doing this and I have a different script for that let me know.

Here it is: (Copy and paste in Notepad, save as "AddPrinter.vbs") or Download below.

Code:
' Add Local Printer v2.1
' Programmed by WindowsStar - Copyright (c) 2008-2010
' ---------------------------------------------------
On Error Resume Next
Set WShNetwork = CreateObject("WScript.Network")
Set WShShell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Set objEnv = WshShell.Environment("Process")
Title = "Printer Name"
Message = "Name of Printer." & vbLF & vbLF & "Leave blank or press cancel to quit."
strPrinter = InputBox(Message, Title)
If strPrinter = "" Then Wscript.quit
Title = "Printer Driver Name"
Message = "Printer Driver Name." & vbLF & vbLF & "Leave blank or press cancel to quit."
strDriverName = InputBox(Message, Title)
If strDriverName = "" Then Wscript.quit
Title = "Port Name"
Message = "Enter the port you want to use." & vbLF & vbLF & "Enter and IP address (i.e. 192.168.1.1)" & vbLF &  "OR Enter LPT1: for parallel printing." & vbLF & vbLF & "Leave blank or press cancel to quit."
strPort = InputBox(Message, Title)
If strPort = "" Then Wscript.quit
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objPrinter = objWMIService.Get("Win32_Printer").SpawnInstance_
objPrinter.DriverName = strDriverName
objPrinter.PortName   = strPort
objPrinter.DeviceID   = strPrinter
objPrinter.Location = ""
objPrinter.Network = False
objPrinter.Shared = False
objPrinter.ShareName = ""
objPrinter.Put_
WshShell.Popup "          Done!",5,"Script Message"

Thanks for the help. I figured it out though. All you have to do is run this command first.

Cscript %windir%/System32/Printing_Admin_Scripts/en-US/Prnport.vbs -a -r IP_10.2.3.4 -h 10.2.3.4

rundll32 printui.dll,PrintUIEntry /if /b "Test Printer" /f %windir%\inf\ntprint.inf /r "IP_10.2.3.4" /m "HP Laserjet 4100 Series PCL6"

The first script just adds the port to Windows 7/Vista the second creates the printer. Running the first script wasn't needed in XP.

Thanks for your help.
 

My Computer

OS
Windows 7
I wrote this script (VBScript) a long time ago for adding a printer to Windows XP machines. I tested it and it works on Windows 7. I tweaked it a bit to take the bare minimum input. The biggest problem with it is that you have to know the EXACT name of the driver or the script will fail. If you know all this information and know it well then the script will help you add 2 or 3 printers quickly.

Example use:

Printer Name: HP LaserJet 4500N
Printer Driver Name: HP LaserJet 4500 series PCL6
Port Name: 192.168.1.200

You must have the Printer Driver Name exactly correct or it will fail. If the IP address is wrong or the computer cannot access the IP address this script will fail.

Please NOTE there is no error checking.

If you have the printer shared off a server there is a much better way of doing this and I have a different script for that let me know.

Here it is: (Copy and paste in Notepad, save as "AddPrinter.vbs") or Download below.

Code:
' Add Local Printer v2.1
' Programmed by WindowsStar - Copyright (c) 2008-2010
' ---------------------------------------------------
On Error Resume Next
Set WShNetwork = CreateObject("WScript.Network")
Set WShShell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Set objEnv = WshShell.Environment("Process")
Title = "Printer Name"
Message = "Name of Printer." & vbLF & vbLF & "Leave blank or press cancel to quit."
strPrinter = InputBox(Message, Title)
If strPrinter = "" Then Wscript.quit
Title = "Printer Driver Name"
Message = "Printer Driver Name." & vbLF & vbLF & "Leave blank or press cancel to quit."
strDriverName = InputBox(Message, Title)
If strDriverName = "" Then Wscript.quit
Title = "Port Name"
Message = "Enter the port you want to use." & vbLF & vbLF & "Enter and IP address (i.e. 192.168.1.1)" & vbLF &  "OR Enter LPT1: for parallel printing." & vbLF & vbLF & "Leave blank or press cancel to quit."
strPort = InputBox(Message, Title)
If strPort = "" Then Wscript.quit
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objPrinter = objWMIService.Get("Win32_Printer").SpawnInstance_
objPrinter.DriverName = strDriverName
objPrinter.PortName   = strPort
objPrinter.DeviceID   = strPrinter
objPrinter.Location = ""
objPrinter.Network = False
objPrinter.Shared = False
objPrinter.ShareName = ""
objPrinter.Put_
WshShell.Popup "          Done!",5,"Script Message"

Thanks for the help. I figured it out though. All you have to do is run this command first.

Cscript %windir%/System32/Printing_Admin_Scripts/en-US/Prnport.vbs -a -r IP_10.2.3.4 -h 10.2.3.4

rundll32 printui.dll,PrintUIEntry /if /b "Test Printer" /f %windir%\inf\ntprint.inf /r "IP_10.2.3.4" /m "HP Laserjet 4100 Series PCL6"

The first script just adds the port to Windows 7/Vista the second creates the printer. Running the first script wasn't needed in XP.

Thanks for your help.

Yup I have done it that way too. Glad you have something that works. Enjoy!
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell OP7010
OS
Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
Memory
16GB
Monitor(s) Displays
4 Dell 24" LCD
Screen Resolution
1280x1024
Keyboard
Dell
Mouse
Dell Optical
Internet Speed
40meg

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Home built
OS
Windows 7 Ult, Windows 8.1 Pro,
CPU
Q9650-4.275GHz, E8600 4.5GHz, E6750-3.8GHz
Motherboard
Evga 780i FTW
Memory
G.Skill PC2 9600 1200Mhz 5 5 5 15 2T
Graphics Card(s)
GTX480
Sound Card
Asus Xonar D2
Monitor(s) Displays
HannsG
Screen Resolution
1680X1050
Hard Drives
GSkill Phoenix Pro 120GB SSD
PSU
ThermalTake Toughpower 1000Watt modular
Case
ThermalTake XaserV
Cooling
Xigmatek S1283
Keyboard
Logitech G15
Mouse
Logitech G9
Internet Speed
T1
WindowsStar thats a nice vbs script, but it appears to be a one-off approach. I run a network with over 50 WAN sites in our XP workstation environment, and have developed a looping prnport.vbs/printui.dll machine startup script run via GPO that is easily customizeable to install anywhere from one to dozens of printers at each site.

But it doesn't want to work in W7. please help

Code:
Here's the script:
::==============================================
::Written by Matt Lieblong Copyright 2009-2010
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION 
SET P1=%AestheticNameOfPrinter
SET PIP1=%1x.x.x.x
SET PNAME1=%"TOSHIBA eS452/453Series PCL6"
SET PDRIVER1=%"[URL="file://localsitepcname/PRINTERDRIVERS/352-353-452-453/eB4ox2.inf"]\\LocalSitePCname\PRINTERDRIVERS\352-353-452-453\eB4ox2.inf[/URL]"
 
SET P2=%AestheticNameOfPrinter2
SET PIP2=%1x.x.x.x
SET PNAME2=%"TOSHIBA e-STUDIO Series Fax"
SET PDRIVER2=%"[URL="file://localsitepcname/PRINTERDRIVERS/ALLMODELSLANFAX/eS4cfx2k.inf"]\\LocalSitePCname\PRINTERDRIVERS\ALLMODELSLANFAX\eS4cfx2k.inf[/URL]"
 
SET P3=%AestheticNameOfPrinter3
SET PIP3=%1x.x.x.x
SET PNAME3=%"TOSHIBA eS452/453Series PCL6"
SET PDRIVER3=%"[URL="file://localsitepcname/PRINTERDRIVERS/352-353-452-453/eB4ox2.inf"]\\LocalSitePCname\PRINTERDRIVERS\352-353-452-453\eB4ox2.inf[/URL]"
 
FOR %%N IN (1 2 3) DO (
SET P=!P%%N%!
FIND | REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\!P!"
IF ERRORLEVEL 1 (
SET PIP=!PIP%%N%!
SET PNAME=!PNAME%%N%!
SET PDRIVER=!PDRIVER%%N%!
ECHO !P!
ECHO !PIP!
ECHO !PNAME!
ECHO !PDRIVER!
cscript.exe c:\windows\system32\prnport.vbs -a -r !P! -h !PIP! -o raw -n 9100
rundll32 printui.dll PrintUIEntry /if /b !P! /f !PDRIVER! /r !P! /m !PNAME! /z 
)
)
::END OF SCRIPT, AFTER CUSTOMIZING FOR A SITE, DELETE EVERYTHING PAST THIS LINE
::THE FOLLOWING IS LOCAL PRINTER VARIABLE TEMPLATE INFO
::DEFINE A MASTER DRIVER FOLDER, FROM WHICH TO COPY THE VARIOUS MODEL'S INFO
::TO A PRINTER VARIABLE DECLARATION ABOVE (THIS JUST SPEEDS UP WRITING MULTIPLE
::SCRIPTS). ONCE SCRIPT IS WRITTEN, DELETE THIS PARAGRAPH AND EVERYTHING BELOW, 
::NAME FILE AS PRNSITENAME.BAT OR SIMILAR TO BE SAVED IN DOMAIN sysvol OR policy 
::FOLDERS.
 
::202-203-232-233-282-283
:: TOSHIBA eS282/283Series PCL6
:: \PRINTERDRIVERS\202-203-232-233-282-283\eB2ox2.inf
::
::352-353-452-453
::TOSHIBA eS452/453Series PCL6
::\PRINTERDRIVERS\352-353-452-453\eB4ox2.inf
::
::520-523-600-603-720-723-850-853
:: TOSHIBA eS850/853Series PCL6
:: \PRINTERDRIVERS\520-523-600-603-720-723-850-853\eB8mx2.inf
::
::205-255-305-355-455
::TOSHIBA e-STUDIO455Series PCL6
:: \PRINTERDRIVERS\205-255-305-355-455\eS4px2.inf
::
::ALLMODELSLANFAX (for all toshiba models' print-to-fax feature)
:: TOSHIBA e-STUDIO Series Fax
:: \PRINTERDRIVERS\ALLMODELSLANFAX\eS4cfx2k.inf
::
::Dell1710n
:: Dell Laser Printer 1710n
:: \PRINTERDRIVERS\Dell1710n\DKAAY2DA.inf
::
::Dell1720dn
:: Dell Laser Printer 1720dn
:: \PRINTERDRIVERS\Dell1720dn\c.inf (yes the file is named c.inf)
::
::Dell2330dn
:: Dell 2330d Laser Printer
:: \PRINTERDRIVERS\Dell2330dn\DKACHL40.inf
::
::Dell2335dn
:: Dell 2335dn MFP
::\PRINTERDRIVERS\Dell2335dn\sdf1m.inf
::
::Dell3130c
:: Dell 3130cn Color Laser PCL6
:: \PRINTERDRIVERS\Dell3130c\dlxbmzi.inf
::
::Lexmark T630-T632
:: Lexmark T630
:: OR
:: Lexmark T632
:: \PRINTERDRIVERS\LexmarkT630-T632\lmaaga40.inf
::
::HP OfficeJet Pro L7700
:: HP Officejet Pro L7700 Series BT
::
::
::TEMPLATE TO MACHINE INSTALL A LOCALLY SHARED PRINTER ON ANOTHER MACHINE
::SO FAR TESTS REQUIRE NO INSTALL CHECK, AS IT WILL NOT INSTALL DUPLICATES
::IF ALREADY INSTALLED...
::LOCAL SHARE OF HP4 PRINTER INSTALL on computer [computername] used by [users name]:
:: RUNDLL32 PRINTUI.DLL PrintUIEntry /ga /in /n\\computername\printersharename
::TO DELETE A LOCALLY INSTALLED PRINTER (WHICH IS WHAT THE ABOVE SCRIPT INSTALLS)
:: RUNDLL32 PRINTUI.DLL PrintUIEntry /dl /n "printername" /q
 
::NOTES ON USING THIS SCRIPT:
::THIS SCRIPT IS IDEAL FOR AUTOMATICALLY INSTALLING PRINTERS ACROSS VARIOUS WAN SITES
::USING GP/GPO FEATURES. USEFUL FOR THOSE WHO HAVE NUMEROUS WAN SITES, BUT NOT PRINT
::SERVERS AT ALL WAN SITES, ESPECIALLY WITH SLOW CONNECTIONS TO A CENTRAL HUB OR MAIN
::PRINT SERVER. TO USE THIS SCRIPT, YOU MUST USE/SETUP THE FOLLOWING:
::
::1. ACTIVE DIRECTORY/GROUP POLICY FUNCTIONALITY
::2. AD ORGANIZATIONAL UNIT FOR EACH WAN SITE, WITH ALL RESPECTIVE PC'S ASSIGNED WITHIN
::3. GPO FOR EACH SITE, WITH ONLY ONE SETTING: ASSIGN MACHINE STARTUP SCRIPT WITH 
:: RESPECTIVE WAN SITE'S UNIQUE SCRIPT LISTED
::4. GPO TO ENABLE THE "UNSIGNED DRIVER INSTALLATION BEHAVIOR" TO "SILENTLY SUCCEED", 
:: THIS GPO IS MOST SIMPLY ASSIGNED TO THE OU CONTAINING ALL WAN OU'S, OR COULD
:: BE INCORPORATED INTO EACH WAN SITE'S STARTUP SCRIPT GPO.
::5. FOR SITUATIONS WITH SLOW LINKS BETWEEN WAN SITES AND CENTRAL HUB FILESERVERS, 
:: CREATE A "PRINTERDRIVER" SHARE ON ONE COMPUTER AT EACH WAN SITE, FROM WHICH
:: TO SERVE THE INF-BASED LOCAL PRINTER INSTALLATIONS. THIS SPEEDS UP DRIVER
:: DOWNLOADS SIGNIFICANTLY, AND HAS LITTLE EFFECT ON SHARING PC OVERALL.
::
::I WROTE THIS AS I COULD FIND NOTHING SIMILAR ELSEWHERE. IT'S ALL IN BATCH, IT'S QUITE
::RUDIMENTARY, HOWEVER IN MY CASE, I WAS ABLE TO WRITE AND DEPLOY THIS TO ~70 WAN SITES, 
::WITHIN A WEEK USING THIS SCRIPT. MUCH EASIER AND FASTER IN THE LONG RUN THAN RUNNING
::A PRINT SERVER, IT CREATES IP PORTS AND LOCALLY INSTALLS NETWORK PRINTERS. PRINTERS CAN
::BE INSTALLED, MODIFIED, AND DELETED ALL WITHIN THE SCRIPT. THE INSTALL LOOP CONTAINS
::A REGISTRY CHECK TO DETERMINE IF A PRINTER HAS BEEN INSTALLED ALREADY AT THE REGISTRY
::LEVEL. INITIAL INSTALL TAKES A FEW SECONDS PLUS TIME TO COPY/DOWNLOAD THE DRIVER FROM 
::YOUR LOCAL PRINTERDRIVER SHARE, PER PRINTER INSTALL. OVER A COMMON 10/100 SWITCH IT 
::TAKES ABOUT 5-10 SECONDS FOR LARGER (7MB) MFP PRINTER DRIVERS.
::
::IF YOU ESTIMATE 5 MINUTES PER INSTALL, THIS ENABLED ME TO INSTALL ALL NETWORK OR SHARED
::PRINTERS AT OVER 70 WAN SITES WITH ABOUT 1 WEEKS WORTH OF WORK. EQUIVALENT TO SEVERAL
::MONTHS TIME IF PERFORMING MANUAL INSTALLS OF SAME PRINTERS.
 

My Computer

Computer Manufacturer/Model Number
DELL
OS
W7 32
@MattLieblong

Are your all Windows XP machines 32bit? Are all your Windows 7 Machines 32bit? Are all your drivers universal?? Meaning the print drivers work for XP and 7??
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell OP7010
OS
Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
Memory
16GB
Monitor(s) Displays
4 Dell 24" LCD
Screen Resolution
1280x1024
Keyboard
Dell
Mouse
Dell Optical
Internet Speed
40meg
WindowsStar thats a nice vbs script, but it appears to be a one-off approach. I run a network with over 50 WAN sites in our XP workstation environment, and have developed a looping prnport.vbs/printui.dll machine startup script run via GPO that is easily customizeable to install anywhere from one to dozens of printers at each site.

But it doesn't want to work in W7. please help

Maybe the directions for setting up a printer via GPO will help.

Deploying Printers by Using Group Policy

There are also some settings to enable printer set up via GPO starting about a third of the way down this Technet page that might interest you.

http://social.technet.microsoft.com...P/thread/8c7f439c-be8c-4511-99fd-566985522673

Towards the bottom of the page you see tricks like this...
Try to deploy your printers directly via the printserver - server manager - select printserver - printers
right click on the printer -- select "Deploy with Group Policy"
- click on browse --> find the desired policy
- select if you want to deploy the printer "per computer" or "per user" and click "add"
after that - gpupdate on the client - and voilà the printers are listed....
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Home built
OS
Windows 7 Ult, Windows 8.1 Pro,
CPU
Q9650-4.275GHz, E8600 4.5GHz, E6750-3.8GHz
Motherboard
Evga 780i FTW
Memory
G.Skill PC2 9600 1200Mhz 5 5 5 15 2T
Graphics Card(s)
GTX480
Sound Card
Asus Xonar D2
Monitor(s) Displays
HannsG
Screen Resolution
1680X1050
Hard Drives
GSkill Phoenix Pro 120GB SSD
PSU
ThermalTake Toughpower 1000Watt modular
Case
ThermalTake XaserV
Cooling
Xigmatek S1283
Keyboard
Logitech G15
Mouse
Logitech G9
Internet Speed
T1
Yes the drivers are all the manufacturer drivers for both XP & W7.

The script I posted was the original script that I ran for all 32bit XP machines. I have toyed around with modifying for the different location of the prnport.vbs as in...

cscript.exe c:\windows\system32\Printing_Admin_Scripts\en-US\prnport.vbs -a -r !P! -h !PIP! -o raw -n 9100

but that is still problematic. I either get 0x00000035 or 0x000006be errors.

I actually get the original XP script to work partially on a 32bit W7 machine if i copy the contents of c:\windows\system32\Printing_Admin_Scripts\en-US to the c:\windows\system32 folder where they used to be on XP.

Can anyone explain the difference in W7 regarding these scripts?
 

My Computer

Computer Manufacturer/Model Number
DELL
OS
W7 32
To address other possible questions...

I decided NOT to use a print server due to the fact that we have 70 sites across a state, many of which operate on fractional frame relay (SLOW!) WAN links, also eliminating a centralized print server eliminates printing failures if the WAN link goes down, which happens more than I wish.

I have that script run at every startup to verify all office printers are installed per office at a machine level, so all names are identical, simpler to identify for users. it does a registry check to verify the printers are installed with the exact name i give.

the script is kind of messy, but very logical for a batch script. And spaghetti code or not, at my large offices i can deploy multiple new printer installs across all machines by only updating the script in a few minutes, and forcing restarts of the machines in groups so as not to traffic jam the request of the drivers.

I put a local open file share on 1 pc at each site that serves as the local printerdriver share. this speeds up the printui.dll /if install significantly, even over 10/100 switch is only a few seconds.

we don't have resources to put a server/printserver at each location, and honestly, if we did that would be more of a headache than managing 70 of these scripts. i only have to change these scripts when a printer changes.
 

My Computer

Computer Manufacturer/Model Number
DELL
OS
W7 32
@MattLieblong

How do you deploy the scripts? Are the scripts on each machine? or are they stored somewhere? Is the registry key to tell you if they get a certain printer or to tell you which printers they get?
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell OP7010
OS
Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
Memory
16GB
Monitor(s) Displays
4 Dell 24" LCD
Screen Resolution
1280x1024
Keyboard
Dell
Mouse
Dell Optical
Internet Speed
40meg
Back
Top