Solved

I need users to be prompted to set default printer at logon

Posted on 2009-04-01
7
275 Views
Last Modified: 2013-12-26
Hello,
i have users that jump all around form computer to computer in a big facility.  I cannot base default printer by username since they roam around from machine to machine.  I am trying to setup a script that will run locally on the machine (startup folder) and prompts the user to select their default printer from the available printers on the machine.  I currently have several IP based printers installed on the machine.  I assume this can be done with a .bat file or .vbs file but cannot find any code to do what im looking for..any assistance would be great..
its a windows server 2003 domain environment with windows xp pro clients.
0
Comment
Question by:dpedersen
7 Comments
 
LVL 70

Expert Comment

by:KCTS
ID: 24045710
0
 
LVL 14

Expert Comment

by:BigBadWolf_000
ID: 24045780
Copy the script below to notepad
Save as filename.vbs
Run it at startup

It will bring up the Printers & Faxes window
and a message box telling users to select their default printer
Set objApp = CreateObject("WScript.Shell") 
objApp.Run "Control Printers", 0, True
WScript.Echo "Please Select Your Default Printer"
Set objApp = Nothing

Open in new window

0
 
LVL 6

Expert Comment

by:Grizzly072000
ID: 24045840
0
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
LVL 14

Accepted Solution

by:
BigBadWolf_000 earned 500 total points
ID: 24046530
If you want to customize further to make it easier on the user. You can use this script.
in the MsgTxt replace the 1. PrinterA with your printer name and so on...
In Select Case section ....match PrinterA to ur printer name and change the server path to the specific printer...
In Case Else section
Change the path to the default printer should the user choose cancel or forgets to input choice number

MsgTxt = vbNothing
MsgTxt = MsgTxt  & vbCrLf & "Select your default printer" 
MsgTxt = MsgTxt  & vbCrLf & "1. PrinterA"
MsgTxt = MsgTxt  & vbCrLf & "2. PrinterB"
MsgTxt = MsgTxt  & vbCrLf & "2. PrinterC"
MsgTxt = MsgTxt  & vbCrLf & "2. PrinterD"
    
DefaultPrinter = InputBox(MsgTxt,"Select Default Printer")
 
Set WSHNetwork = WScript.CreateObject("WScript.Network")   
    
Select Case DefaultPrinter
     Case "1","PrinterA"
       WSHNetwork.SetDefaultPrinter "\\ServerName\PrinterA_PrinterName"
     Case "2","PrinterB"
       WSHNetwork.SetDefaultPrinter "\\ServerName\PrinterB_PrinterName"
     Case "3","PrinterC"
       WSHNetwork.SetDefaultPrinter "\\ServerName\PrinterB_PrinterName"
     Case "4","PrinterD"
       WSHNetwork.SetDefaultPrinter "\\ServerName\PrinterB_PrinterName"
 
     Case Else
       WSHNetwork.SetDefaultPrinter "\\ServerName\Generic_PrinterName"
 
End Select
 
Set WSHNetwork = Nothing

Open in new window

0
 
LVL 14

Expert Comment

by:BigBadWolf_000
ID: 24046544
ooops...in Msgtxt ....change the selection numbers to 1,2,3,4...I left them as 1,2,2,2...pleas correct
0
 

Author Closing Comment

by:dpedersen
ID: 31565606
THAT IS AWESOME and exactly what i want.  One change i made:
instead of \\servername\printerb...
i have local printers and found that i can just put in quotations there the windows printer name IE:  "HP Laserjet 1015" and it works.

THANK YOU SO MUCH...
0
 
LVL 14

Expert Comment

by:BigBadWolf_000
ID: 24051003
Your welcome. Happy to help.
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Chocolatey under PowerShell is not working properly 3 78
vbModal 12 66
How to read File Date Created using VB6 8 63
BATCH to EXE Converter 2 71
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

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