≡ Menu

Set default printer in Windows 7

In Windows 7, we can set default printer from control panel -> Devices and printers.  For Windows geeks and system administrators, here’s a command line tip for doing the same with a simple wmic command.  Read on…

First, let’s get the list of printers installed on the computer. You can run the below command for this list.

wmic printer get name,default

Example: the above command prints the following on my computer.

c:\>wmic printer get name,default
Default  Name
FALSE    Send To OneNote 2010
FALSE    Eng_Printer_1stFloor
FALSE    HR_printer_2ndFloor
FALSE    Microsoft XPS Document Writer
FALSE    Fax

As you can see it also tells us which one is the default printer.

Get default printer name

wmic printer where default='TRUE' get name

Set default printer

Now the syntax for setting a new default printer:

wmic printer where name='printername' call setdefaultprinter

The default printer in our example is ‘HP_COLOR_PRINTER’. Now let’s change it to ‘Eng_Printer_1stFloor’. The command for this would be.

wmic printer where name='Eng_Printer_1stFloor' call setdefaultprinter

This command also works on Server 2008. Though I have not verified it, it should work for other Windows editions also(XP, Vista, Server 2003).

Related Posts:

Printer management in XP, Server 2003 from Windows command line.
Manage printer jobs from Windows command prompt.

{ 8 comments… add one }
  • rhian

    how do you query or set default a network printer…

    it say ERROR when i query a network printer such as
    “invalid query”

    wmic printer where name=’\\printserver\printername’ call setdefaultprinter


    • admin

      Problem seems to be that you are using the printer UNC path. Instead use the printer name. You can get the name field using wmic printer get name.
      Also the printer should have been added to the computer before running the command. From the added printers list you can choose one of it as the default one. This list can be obtained from wmic printer get command.

    • andrewb

      You need to delimit your printer name, ie

      wmic printer where name=’\\\\printserver\\printername’ call setdefaultprinter

  • rhian

    thanks andrewb.. work for me. cheers.

  • Jeff

    wmic printer get name, default only captures and returns the local printers, not networked printers. Is there a command that will list the networked printers AND tell me which is set as the default? That’s the thing I’m really fishing for, default printer for every user.

    I’m making printer changes on the server, will need to reset everyone default printer after I’m done so I’m trying to get a list without remotely connecting to each user. I can get to a command line without disturbing the users.

    • Eavn

      It lists my network printers. I have them added by IP. That may make a difference if that isn’t how you have them set up.

    • admin

      The command lists network printers for me too. I have them added with dns name, so either way it works.

    • Mike

      You’re correct Jeff and i’m also looking for a solution for this.

      This command, wmic printer get name, default, will not get the network printers of a remote PC on the network.

      Have you had any luck in searching since it has been 2 years?

Leave a Comment