This Blog is a supplement to my website. Please also visit: www.DavidCocke.com

Tuesday, July 15, 2014

Set Default Printer for All Users

One of our customers has been complaining that as different people logon to a particular Windows 7 computer, they always have to manually set the default printer.  The default printer is always different for each person that logs in and the choice Windows chooses is inconsistent.

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.