Thought this was handy, considering Windows XP likes to randomly change the default printer sometimes. You can use this command in a batch file, script, or whatever in windows to change/set the default printer:
rundll32 printui.dll,PrintUIEntry /y /q /n “Printer name”
-Dave out
Is this a batch command or a windows script command?
By: Michael on Thursday, February 26, 2009
at 10:38 PM
Batch command. Works from command line or a .bat file.
By: Dave on Friday, February 27, 2009
at 11:07 AM
We’re trying to batch set a default printer.
If my printers are network would this be correct?
rundll32 printui.dll,PrintUIEntry /y /q /n\\server\XeroxBlack
I was wondering where one would place the file after it is created. Do I do this on the server or on each of the computers?
By: Jan on Wednesday, June 24, 2009
at 3:56 PM
When you type rundll32 printui.dll,PrintUIEntry /? you get a list of valid commands. That command you typed seems to be correct, but I haven’t used the command in that way. I have only used it to set a default printer that was already locally installed on the PC.
As far as where to place it, that depends on how your network is set up. Do you use login scripts for your users? If so, and they are .bat and not .vbs scripts, then add it there. Otherwise you’d have to but a bat with that command in the startup of every PC.
By: Dave on Friday, June 26, 2009
at 7:32 AM
This is great and all but is there an option to set the printer you are installing as the default. I called up the help on this but cannot find that one option. Any help would be appreciated.
By: Phil on Thursday, October 8, 2009
at 9:26 AM
Not sure, I’ve only used this command to set an existing printer as the default. Not to install a new printer.
You could run a command to install a printer and then right after it in the batch, have this line default it. You’d just need to get the printer name right.
Hope that helps.
By: Dave on Thursday, October 8, 2009
at 6:35 PM
http://gallery.technet.microsoft.com/ScriptCenter/en-us/9e52c5e2-cd0f-413b-acad-a010b031d44d
By: Michael on Wednesday, October 14, 2009
at 5:55 AM
Many Many thanks to all of you for solve my problem. This code you submit is really working. I am working on Network PC. So i wanted to create a batch file which automatically connected the Printer of another Network PC and set it as Default printer. I have created a Batch file which connect the Network Printer and set it as Default Printer. The Code is as Follows
@ Echo off
Net use \\192.168.9.30\HPLaserj smile
rundll32 printui.dll,PrintUIEntry /y /q /n \\192.168.9.30\HPLaserj
in the above code the ‘smile’ word is Password of Network PC which IP address is ‘\\192.168.9.30′
By: Ritesh Kumar on Thursday, October 22, 2009
at 4:22 AM
Glad to help. I often scour google for a quick answer to little tech problems, so when I find something helpful or figure out something cool myself I try to post it here and share the info.
By: Dave on Thursday, October 22, 2009
at 7:23 AM
Very good, indeed you also saved me some time
By: Miguel on Wednesday, December 30, 2009
at 4:05 AM
Thank you for this information. It worked great.
By: Louis on Tuesday, March 16, 2010
at 10:54 AM
This is awesome, I have been trying to figure out a way to do this in VBS or command line….This will resolve my issue with multiple printer selection changes when a wireless laptop moves from location to location in a hospital environment to print data……THANKS!
By: Andy on Tuesday, April 6, 2010
at 11:06 AM
Very grateful for sharing this with us.
By: Paku on Wednesday, April 20, 2011
at 9:01 PM
Please disregard my previous comment. Very grateful for sharing this with us and for sharing freely of your knowledge.
By: Paku on Wednesday, April 20, 2011
at 9:02 PM
A lot of solutions for this kind of questions. But this one is the easyest and perfect solution to change the default printer!!!!!
Thanks a lot
Jürg
By: Jürg on Saturday, July 2, 2011
at 9:29 AM