Solved

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

Posted on 2008-10-21
10
345 Views
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.
Thanks!
0
Comment
Question by:Dwight Baer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
10 Comments
 

Accepted Solution

by:
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
0
 

Author Comment

by:Dwight Baer
ID: 22768468
Wow.
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.
0
 

Author Comment

by:Dwight Baer
ID: 22768925
OK ... I'm working on this ... at the following site ...
http://www.robvanderwoude.com/2kprintcontrol.html

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.


0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

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 http://192.168.0.158", the Proprties shows a name of "NPI612E34".
0
 

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"
0
 

Author Comment

by:Dwight Baer
ID: 22770045
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?
0
 

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.
0
 

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!!!
0
 

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 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.
0
 

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.
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

I'm a big fan of Windows' offline folder caching and have used it on my laptops for over a decade.  One thing I don't like about it, however, is how difficult Microsoft has made it for the cache to be moved out of the Windows folder.  Here's how to …
A simple overview of the possibilities of using technology for project management.
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…

726 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