Solved

Correct Syntax required for Local Printer install using PRINTUI.DLL

Posted on 2007-03-30
7
1,310 Views
Last Modified: 2013-12-15
When I go to install the printer instead of choosing Network printer, I choose local printer, and then choose create new local port, which i point to the network printer. ie. \\10.42.110.14\printer1 this then lets me select a printer driver from the list. However I would like to do this using the Rundll32 PrintUI.dll but I don't know the correct syntax. I need to add 6 printers all of them are hp printers and some share the same driver which automatically comes with hp. Therefore can some one tell me the exact syntax I need to install the following printer: From this I'll be able to install the rest

Printer Name: printer1.
Local Printer Address: \\10.42.110.14\printer1
Driver HP Laserjet 4V/4MV PostScript

Many Thanks
0
Comment
Question by:jasgrif11
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 3

Expert Comment

by:drbayer
ID: 18823152
Here's a good reference site for printui.dll: http://www.dx21.com/SCRIPTING/RUNDLL32/VIEWITEM.ASP?OID=145&CMD=P-A

Another option is to use a quick vbscript - something like:

set oNet = createobject("wscript.network")
oNet.addwindowsprinterconnection "\\10.42.110.14\printer1"
oNet.addwindowsprinterconnection "\\10.42.110.14\printer2"
oNet.setdefaultprinter("\\10.42.110.14\printer1")

Just put in as many addwindowsprinterconnection lines as you need, and only use the setdefaultprinter line if you want to specify which is the default.  If you need the printer to be available at the DOS level, use addprinterconnection and specify the port.
0
 
LVL 38

Expert Comment

by:hdhondt
ID: 18833671
Have a look at this Microsoft Knowledge Base document:

http://support.microsoft.com/kb/314486
0
 

Author Comment

by:jasgrif11
ID: 18835248
I had a look at the Microsoft Knowledge document however this describes how to add a printer using a tcp/ip port. Will the rundll32 printui.dll utility work to add a local port ie. \\10.42.110.12\printer1 if so whats the exact syntax I need. I want to be able to add 6 printers all at once rather then going through the gui.I will also need to add these printers to multiple computers
0
Don't miss ATEN at NAB Show April 24-27!

Visit ATEN at NAB Show to learn how our "Seamlessly Entertaining" solutions deliver fast, precise video streaming without delays for the broadcasting and media environment. ATEN will showcase its 16x16 Modular Matrix Switch (VM1600) and KVM Over IP Solution (KE6900 series).

 
LVL 38

Expert Comment

by:hdhondt
ID: 18835763
The link does show how to create a local TCP/IP printer:

rundll32 printui.dll,PrintUIEntry /if /b "Test Printer" /f
%windir%\inf\ntprint.inf /r "IP_157.57.50.98" /m "HP Laserjet 4000 Series PCL" /Z
0
 

Author Comment

by:jasgrif11
ID: 18836223
So if I use the following command it should work fine??

rundll32 printui.dll,PrintUIEntry /if /b "Printer 1" /f%windir%\inf\ntprint.inf /r "IP_10.42.110.12\printer1" /m "HP Laserjet 4V/4MV PostScript " /Z

How do I find the correct .inf file? can i get it from a system that already has the printer installed? Also is it possible to automatically set the print to print A4 and not letter?
0
 
LVL 38

Accepted Solution

by:
hdhondt earned 500 total points
ID: 18847449
Sorry I have not got back to you for a while.

You should be able to point rundll32 at a server or another PC that has the .inf installed, by adding the hostname (or drive letter) before the %windir% parameter.

As for forcing driver settings, try the following 2 commands (from drbayer's link):

Store all printer settings (from an existing printer) into a file:
rundll32 printui.dll,PrintUIEntry /Ss /n "printer" /a "file.dat"

Restore all printer settings from a file:
rundll32 printui.dll,PrintUIEntry /Sr /n "printer" /a "file.dat"
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you use a Brother DCP 130C or similar Brother printer, at some point you might encounter the following problem: after you change the ink cartridge, the printer displays an "ink empty" message. Sometimes you just need to follow the instructions…
This article may be useful for troubleshooting your PC. Power Supply - no lights or fans running If you have no lights or fans running then either you power is bad, turned off (check switch) or the power supply needs to be replaced. That's a r…
The viewer will learn how to successfully download and install the SARDU utility on Windows 8, without downloading adware.
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question