?
Solved

Set Default Printer for local Printers

Posted on 2014-03-26
4
Medium Priority
?
566 Views
Last Modified: 2014-03-27
Hello,

I have two printers mapped on my Windows 7 machines, "B&W" and "Color". I want the B&W one to be the default for everyone who logs on. Is there a way to script this or use a GPO to force the default? The printers are Pharos printers and not mapped via GPO, they're installed locally on each machine.

Thoughts?

Thanks
0
Comment
Question by:Jason Watkins
[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
  • 2
4 Comments
 
LVL 13

Accepted Solution

by:
lciprianionut earned 2000 total points
ID: 39955968
You can use below script (is VBS, I can give you PowerShell version also) to make it a login script, and put in a GPO or users can run it manually.

strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colInstalledPrinters =  objWMIService.ExecQuery ("Select * from Win32_Printer Where Name = ''B&W")

For Each objPrinter in colInstalledPrinters
    objPrinter.SetDefaultPrinter()
Next
0
 
LVL 10

Expert Comment

by:Sam Simon Nasser
ID: 39955975
check the article here http://support.microsoft.com/kb/252388
To add a default printer for all new users:

   Log on with the Administrator account and install the appropriate default printer.
   Start Registry Editor (Regedt32.exe).
   
Locate the following key:
    HKEY_CURRENT_USER\Software\Microsoft\Windows NT\Current Version\Devices
    Note the information for the value of the key that represents the default printer that you created in step 1. For example, "Generic / Text Only : REG_SZ : winspool,LPT1:" is the printer named "Generic / Text Only" that is installed as a local printer using printer port LPT1. Network printers are listed as \\servername\sharename with a REG_SZ value similar to "winspool,Ne00:".

   On the Window menu, click HKEY_USERS.
   On the Registry menu, click Load Hive.
   In the %SystemRoot%\Profiles\Default User folder, click the Ntuser.dat file, and then click Open.
   In the Key Name box, type ntuser, and then click OK.
   
Open the following key:
    NTUSER\Software\Microsoft\Windows NT\Current Version\Devices
   On the Edit menu, click Add Value. Create the same value you noted earlier. For example, if you are using the sample printer mentioned earlier, "Generic / Text Only" is the value name, "REG_SZ" is the data type, and "winspool,LPT1:" is the string.
   
Locate the following key:
    HKEY_CURRENT_USER\Software\Microsoft\Windows NT\Current Version\PrinterPorts
 
Note the information for the value of the key that represents the default printer that you created in step 1. For example, "Generic / Text Only : REG_SZ : winspool,LPT1:,15,45".
   
Locate the following key:
    HKEY_USERS\NTUSER\Software\Microsoft\Windows NT\Current Version\PrinterPorts
   
On the Edit menu, click Add Value. Create the same value you noted in the previous step. For example, if you are using the sample printer mentioned earlier, "Generic / Text Only" is the value name, "REG_SZ" is the data type, and "winspool,LPT1:,15,45" is the string.
   
Locate the following key:
    HKEY_CURRENT_USER\Software\Microsoft\Windows NT\Current Version\Windows
   
Note the information for the Device value. For example, "Generic / Text Only,winspool,LPT1:".
 
Double-click the Device value in the following key:
    HKEY_USERS\NTUSER\Software\Microsoft\Windows NT\Current Version\Windows
 
Edit the Device value to reflect the information you noted in the previous step. For the sample printer, use "Generic / Text Only,winspool,LPT1:" for the string.
   
Locate the following key:
    HKEY_CURRENT_USER\Printers
 
Make a note of all the values contained in this key and any subkeys. You may want to use the Save Key command on the Registry menu.
 
Select the following key:
    HKEY_USERS\NTUSER
  On the Edit menu, click Add Key. Type Printers for the new key name.
  Click the following key:
    HKEY_USERS\NTUSER\Printers
 
Add all the values that you noted in the step 19. You may want to restore the key that you previously saved. To do this, click the key, and then click Restore Key on the Registry menu.
 
 In the HKEY_USERS window, click the NTUSER key.
 
 On the Registry menu, click Unload Hive.
   Quit Registry Editor.
0
 
LVL 27

Author Comment

by:Jason Watkins
ID: 39956470
I'll give these a try and report back. Thanks!
0
 
LVL 27

Author Closing Comment

by:Jason Watkins
ID: 39960202
This script worked great! Thanks!
0

Featured Post

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!

Question has a verified solution.

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

While working, an annoying popup showing below will come and we cannot cancel or close it form the screen. The error message will come again and again.
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
This Micro Tutorial will teach you the basics of configuring your computer to improve its speed. It will also teach you how to disable programs that are running in the background simultaneously. This will be demonstrated using Windows 7 operating…
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
Suggested Courses

762 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