Adding a printer for all users

By | August 8, 2007

What I was trying to achieve here was to get out of adding a printer each time a new user logged onto a any Windows XP box here. I guess ther are probably a million ways to do this and this is but one, but it is really simple to use and works well.

OK, for this to work you have to be an admin on the target box, you can do this from your own workstation also which is pretty cool and works from Vista or XP. Open a DOS box and type

rundll32 printui.dll,PrintUIEntry /?


OK, for this to work you have to be an admin on the target box, you can do this from your own workstation also which is pretty cool and works from Vista or XP. Open a DOS box and type

rundll32 printui.dll,PrintUIEntry /?

to see available options. The one we are interested in is this

rundll32 printui.dll,PrintUIEntry /ga /n\\computer\printer /c\\computer

the /ga switch installs the printer for the default user so it gets installed at logon for each user, neat ! /n is the shared printer you want add /c is the computer you want to install this on. However, what we wanted to do in this particular case was to add a printer to a PC for all users that print direct to the printer, this was for a few reasons, the main one was the user had no rights on the domain and therefore no rights to this printer spooled of a server, so what I wanted was to be able to add a printer for all users that went straight to the printer, this should work for just about any HP networked laserjet, mine was a 4050N.

rundll32 printui.dll,PrintUIEntry /ga /il /c\\computer

Here I don't name the computer, I tell it to use the UI to install it, again this can be done remotely which is cool. This will install a printer to PC "computer" using the Add printer Wizard. So, when it starts up say

1) Next
2) Create New Port
3) Standard TCP/IP Port
4) Next
5) IP address, leave port name alone
6) Finish
7) Select driver
8) Keep existing if asked
9) Next
10 Name it
11) Share or not, probably not
12) Test Page

Now every person who logs on to that PC will be able to print directly to the printer 🙂 Hope that helps someone.

Leave a Reply