Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printers for all 14

Status
Not open for further replies.

kjb21

MIS
May 23, 2003
7
US
I have an XP Pro computer that I setup on my domain. Loaded the printers under my Domain admin account. When another user logs on they do not see the printers. I'd like all users to have the printers when the log-on.
 
I have users run the following batch file that corresponds to the network printer that they want to install.

rem /y makes printer default

rundll32 printui.dll,PrintUIEntry /in /n \\server\printername
rundll32 printui.dll,PrintUIEntry /in /n \\server\nextprintername /y

If I have 20 printers, I have 20 batch files. That way when users go from one machine to another they can install whatever printer they want without asking me to do it for them. The batch file can also install all twenty printers if I put them all in there. This has saved me LOTS of time.
 
Additional, I found (run from a cmd session)

Code:
rundll32 printui.dll,PrintUIEntry /?

very informative...

HTH
TonHu
 
Dillinger99,

What a terrific find on your part.

Thank you very much for sharing the potential of rundll32,PrintUIEntry in script and batch files.

Just a great discovery.

Thanks.
Bill
 
I added network printers under a normal user account and then copied that profile to the default user profile. When someone logs in for the first time the printers will be set up for them. Also, I set up the drive mappings and desktop appearance (windows classic, etc.).
 
I hope so,

Now, answer a thread I started months ago. Where in heck is the documentation for all the possible uses of rundll32 under XP?

You found a killer resource. I would like to flush out the rest of them.

Again, my best wishes.
Bill
 
Dillinger99,

Exactly what I was looking for.

Thank you. Now if I can figure out how to print the darn thing as a reference...

Great link, great find.

Best,
Bill
 
Dillinger99,

Without saying "rename your printers", how can I apply this to network printers with names longer that 8 characters?

I'm guessing I can't right?

Cheers
 
Shearergol,

We have printers with names longer than 8 characters, and it's not presented a problem for me. For example, rundll32 printui.dll,PrintUIEntry /in /n \\SERV2KS19\C2-BILLING-HP9000-PS works for me. I wonder if you could enclose a longer name in quotation marks.
 
OK, now I'm really confused. Just tried it again and it works perfectly (that's without changing the script).

Me tinks dee gremlins be in! :-s

Thanks anyway, this has to be the best thread I've ever seen, and the one thing I've been looking to sort for ages. Cheers Dillinger99!

Mark
 
OK, as soon as I put /y it comes up with the error that the printer name does not exist. I guess it only happens when it is the first printer though.
 
I did find out at that if you're only going to install one printer and set it as the default, you have to have two lines, as in:

rundll32 printui.dll,PrintUIEntry /in /n \\DAYLMBnts10\C2-SE-HP5K-PS
rundll32 printui.dll,PrintUIEntry /in /n \\DAYLMBnts10\C2-SE-HP5K-PS /y

Otherwise, you'll get an error.
 
Dillinger99,

I found the same behavior, and opted for convenience to do the sequence:

. devcon remove the lpt1 from local machine
. net use lpt1 let windows net services do the printer map
. then your trick with the /y option to define the printer as the default.

I used the "net use" although I found as you that if I rundll32 twice for the printer specification XP clients were happy because I found it more reliable when scripting or batching using macro expansion of Environmental Variables. e.g. \\%printer_server%\%this_printer%

I mention only one other practical feature of using NET USE in combination with rundll32 that you have access to the /Persistant:y feature. Most network requirements for scripting of printer assignments are relatively static, so a persistant mapping of the printer shares gives you some comofort that even if for some reason you script/batch fails on a particular logon session the mapping will likely persist.

Best.
Bill

(And hey, I rescued this thread from the way-back pages because I forgot to star you for your well deserved post. Sounds like your clever tip has found a greater audience. Just great stuff.)

Bill
 
To All,
Thanks for all the help. Just found this forum, looks like a great resource.[2thumbsup]
 
Sorry to bring this one back up :p

Anyone got any tips for doing the same thing with 98/NT machines?

Cheers

Mark
 
You can use the net use lptx: \\printer_server\printer syntax in a batch file.

e.g.

rem Clear existing assignments
net use lpt1: /d

rem Add Printer HPLaser4 on Server Back_Office
net use lpt1: \\Back_Office\HPLaser4

rem ==== end of batch file

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top