How to quickly set a new printer as the default for all users?

Posted on 2008-10-21
Last Modified: 2013-11-25
I just added a new printer on my Windows Vista (or XP) machine.  How can I quickly set this printer as the default for all users?
When I log in as a different user, the printer is there as one of the printer choices.  But it's not the default until I manually set it to be the default for each user.
Question by:Dwight Baer
  • 9

Accepted Solution

Fess332 earned 500 total points
ID: 22768001
Printers can be mapped automatically by using login scripts. you can use the printui.dll from windows, one of the switches allows default printer setting, see below

Usage: rundll32 printui.dll,PrintUIEntry [options] [@commandfile]
   /a[file] binary file name
   /b[name] base printer name
   /c[name] unc machine name if the action is on a remote machine
   /dl delete local printer
   /dn delete network printer connection
   /dd delete printer driver
   /e display printing preferences
   /f[file] either inf file or output file
   /ga add per machine printer connections
   /ge enum per machine printer connections
   /gd delete per machine printer connections
   /h[arch] driver architecture one of the following, Alpha | Intel | IA64 | x64
   /ia install printer driver using inf file
   /id install printer driver using add printer driver wizard
   /if install printer using inf file
   /ii install printer using add printer wizard with an inf file
   /il install printer using add printer wizard
   /in add network printer connection
   /j[provider] print provider name
   /k print test page to specified printer, cannot be combined with command when installing a printer
   /l[path] printer driver source path
   /m[model] printer driver model name
   /n[name] printer name
   /o display printer queue view
   /p display printer properties
   /q quiet mode, do not display error messages
   /r[port] port name
   /s display server properties
   /Ss Store printer settings into a file
   /Sr Restore printer settings from a file
   Store or restore printer settings option flags that must be placed at the end of command:
      2      PRINTER_INFO_2
      7      PRINTER_INFO_7
      c      Color Profile
      d      PrinterData
      s      Security descriptor
      g      Global DevMode
      m      Minimal settings
      u      User DevMode
      r      Resolve name conflicts
      f      Force name
      p      Resolve port
   /u use the existing printer driver if it's already installed
   /t[#] zero based index page to start on
   /v[version] driver version one of the following, Windows 95, 98 and Me | Windows NT 4.0 | Windows NT 4.0 or 2000 | Windows 2000 or XP | Windows XP
   /w prompt the user for a driver if specified driver is not found in the inf

Author Comment

by:Dwight Baer
ID: 22768468
If my printer name is "LJ4350" and the .inf file is in "C:\4350", for example, can you give me the syntax to add this as the default printer in a login script?  The printer driver files are already installed for one user on the computer.

Author Comment

by:Dwight Baer
ID: 22768925
OK ... I'm working on this ... at the following site ...

I found:
Set printer as default  -
RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n "printer"

But when I put this line into a .bat file and run it from the command line, I get the following error:

Operation could not be completed. Either the printer name was typed incorrectly, or the specified printer has lost its connection to the server.  For more information, click Help.

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.


Author Comment

by:Dwight Baer
ID: 22768960
P.S.  I copied the printer name directly from the Properties window of that printer.  In this case, for the printer that shows up in the description as "NPI612E34 on", the Proprties shows a name of "NPI612E34".

Author Comment

by:Dwight Baer
ID: 22768978
P.P.S.  Here is the entire file that I called "aaa.bat":

RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n "NPI612E34"

Author Comment

by:Dwight Baer
ID: 22770045
At the following Microsoft site: ... it says:

Windows XP permits you to install a printer from the command line. This is particularly useful when you use a logon script or a scheduled event to add or remove a printer from a group of users.
Type (for example):
rundll32 printui.dll,PrintUIEntry /?

But ... on my Windows XP Professional machine, with SP3 installed, there is no rundll32 command.  What's going on?

Author Comment

by:Dwight Baer
ID: 22787699
Hey Fess32 or anyone,
Thanks for the tip about using rundll32.  But you haven't responded with a sample syntax.  And what about "There's no rundll32 in my Windows XP environment?"
I think this is a tough question.  Maybe there are sample scripts out there?
Thanks a lot.

Author Comment

by:Dwight Baer
ID: 22822836
Update:  I just received an e-mail from Experts Exchange reminding me of this open question.  It's been open for a week.  Meanwhile, I only received one response.  As I indicated in my subsequent post:
- First of all, it would be very helpful to see a sample syntax for the rundll32.exe command.  The "Usage" output is pretty deep.
- Secondly, my computer doesn't even have the rundll32.exe command in its environment.

What is one supposed to do on Experts Exchange when the only response one gets to a valid question is a) not very helpful and b) mostly irrelevant for my situation?  

I'm leaving this question up because I think it's a good question and I believe there's an answer out there.  At the very least, there should be an answer with regard to what OS's typically have the rundll32.exe command in their environment.

I remain thankful, as always for Experts  Exchange!!!

Author Comment

by:Dwight Baer
ID: 22823151
OK ... I think I have egg on my face.  I found rundll32.exe in the System32 folder on an XP machine with SP3 installed.  Not sure why it wasn't there the other day I looked.  

At  there are some good tips about rundll32.exe.

I think I'll close this now.

Author Closing Comment

by:Dwight Baer
ID: 31508309
I think this was a very tough question to answer.  But nevertheless, after a week of having this question open, Fess32 didn't reply with any response to my repeated follow-up posts.

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article, you will read about the trends across the human resources departments for the upcoming year. Some of them include improving employee experience, adopting new technologies, using HR software to its full extent, and integrating artifi…
Learn how ViaSat reduced average response times for IT incidents from 10 minutes to 30 seconds.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question