?
Solved

Correct Syntax required for Local Printer install using PRINTUI.DLL

Posted on 2007-03-30
7
Medium Priority
?
1,312 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
Plug and play, no additional software required!

The ATEN UE3310 USB3.1 Gen1 Extender Cable allows users to extend the distance between the computer and USB devices up to 10 m (33 ft). The UE3310 is a high-quality, cost-effective solution for professional environments such as hospitals, factories and business facilities.

 
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 1500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When I recently replaced my image transfer kit on my office HP color laserjet 5550dn printer, I had a slight problem.  The left bracket that holds the transfer kit got stuck in the upright locked position instead of being at a 45 degree angle facing…
pc, laptop  monitor connection configurations
The viewer will learn how to successfully download and install the SARDU utility on Windows 8, without downloading adware.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Suggested Courses

765 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