You could use Group Policy to specify the default printer, but this seemed like overkill considering we are only having this issue on one computer. In searching the forums, I found a reference to this website: http://www.robvanderwoude.com/2kprintcontrol.php
This led me to learn about the PRINTUI.exe command. At a CMD prompt, if you type printui and {ENTER} you will see a list of available command line options.
In our case, we clicked START, Devices and Printers, right-clicked on the printer that we wanted to set as the default printer, and chose "Printer Properties". Then copied the name of the printer exactly as it appears at the top of the General tab to the clipboard to use in the next step.
We then created a SetDefaultPrinter.cmd file and placed it in the All Users Startup folder:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
The contents of the SetDefaultPrinter.cmd contains just one line:
printui.exe /y /n "HP LaserJet P3011/P3015 PCL6"
The "y" tells it to set the default printer and "n" is the name of the printer you want.
Now, no matter who logs into that PC, this command will automatically run and correctly set the default printer.
Very nice. Simple but gets the job done. Thank you!!
ReplyDeleteThanks so much for sharing! This is perfect.
ReplyDeleteI had to use this format on a Server 2012R2 to get it to work.
ReplyDeleterundll32.exe printui.dll PrintUIEntry /y /n\\server\printername
Very Nice. Yours worked like a charm for me. All of my printers are shared from our server so this is the way they should be mapped in that case. If the Printer is connected directly to the computer, the OP is correct.
DeleteThanks for this helpful page David and thanks Rob for the "\\SERVER" hint. Other hints like above said to use the printer name in General, but when using a share on the server the \\SERVER (or whatever the server name is) is needed.
ReplyDeleteThe first method or second (rundll32.exe printui.dll PrintUIEntry /y /n\\server\printername) did not work for me on Windows Server 2012 R2.
ReplyDeleteReally helpful. Thank you!
ReplyDeleteStupid win 10! Reinstalled and hunting all over for this. THANK YOU THANK YOU. BTW I just copied your line, did a winkey-R, pasted, edited, hit return and done
ReplyDeleteHow do I get the script to run for regular users ? It only runs on startup with admin accounts.
ReplyDeleteThanks
same problem here....
DeleteVery simple and nice. Works like a rocket.
ReplyDelete