• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 351
  • Last Modified:

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

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.
Dwight Baer
Dwight Baer
  • 9
1 Solution
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
Dwight BaerStudentAuthor Commented:
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.
Dwight BaerStudentAuthor Commented:
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.

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Dwight BaerStudentAuthor Commented:
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".
Dwight BaerStudentAuthor Commented:
P.P.S.  Here is the entire file that I called "aaa.bat":

RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n "NPI612E34"
Dwight BaerStudentAuthor Commented:
At the following Microsoft site:
http://support.microsoft.com/kb/314486/ ... 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?
Dwight BaerStudentAuthor Commented:
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.
Dwight BaerStudentAuthor Commented:
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!!!
Dwight BaerStudentAuthor Commented:
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 http://vlaurie.com/computers2/Articles/rundll32.htm  there are some good tips about rundll32.exe.
Also http://www.robvanderwoude.com/rundll.html

I think I'll close this now.
Dwight BaerStudentAuthor Commented:
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 9
Tackle projects and never again get stuck behind a technical roadblock.
Join Now