Solved

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

Posted on 2008-10-21
10
341 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
  • 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
 

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
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Communication between departments might not happen in two different languages, but they do exist in two different worlds. With different targets and performance goals the same phrase often means something completely different to each party. Learn ho…
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup". After a while, you have entered a loop for Auto repair which does not fix anything and you will be in a  panic as all your work w…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now