Jump to content

Detect local printer, check if connected, use as default if connected?


Recommended Posts

Posted

I'd like to be able to provide the following at login for certain users / computers. Deployment of the settings is easy.

 

When a user logs on (and/or a computer starts up).....

 

  1. Detect if a local USB-connected printer is installed
  2. Detect if the local USB-connected printer is connected
  3. If it is installed and connected, set it as the default printer
  4. Otherwise set an appropriate network printer as the default

 

It's the reliable detection logic that's escaping me at the moment. Any ideas?

Posted
Not without a lot of code and to be honest, I don't see the point. You can deploy printers with 2003 R2 or 2008 based on per user or per computer or a combination.
Posted
Not without a lot of code and to be honest, I don't see the point. You can deploy printers with 2003 R2 or 2008 based on per user or per computer or a combination.

 

The problem there is, as I've discovered today is that the default printer is set to the depoyed printer.

 

Win 7 is proving to be a bit of a pain with it's default printer choice the first time a user logs in. Even if there is a local printer my experience so far is that it decides to use a network printer as the default and whilst a user can change it back and it stays back this first time issue is confusing/irritating people.

Posted

i cheat i just make sure all local printers are called "local printer" and use a vbs to select that as default (if it dosent exist then it just exits) will still select it if its off though

 

' Printers.vbs - Jonathan
Option Explicit
Dim objNetwork

On Error Resume Next

Set objNetwork = CreateObject("WScript.Network")

'objNetwork.RemovePrinterConnection "\\server2\MonoPhot", true, true 
'objNetwork.RemovePrinterConnection "\\server2\Photocopierbw", true, true
'objNetwork.RemovePrinterConnection "\\server2\suitebw01", true, true
'objNetwork.RemovePrinterConnection "\\server2\suitecol01", true, true
'objNetwork.RemovePrinterConnection "\\server2\SWS", true, true


objNetwork.AddWindowsPrinterConnection "\\server2\Colour_copier"
objNetwork.AddWindowsPrinterConnection "\\server2\Lasercol"
objNetwork.AddWindowsPrinterConnection "\\server2\Mono copier"

objNetwork.SetDefaultPrinter "\\server2\mono copier"
objNetwork.SetDefaultPrinter "Local Printer"

Posted
i cheat i just make sure all local printers are called "local printer" and use a vbs to select that as default (if it dosent exist then it just exits) will still select it if its off though

 

Yes, that idea had occured to me today on the way into work. Bit of a faff to rename the local printers... usfull if you think of it at the start.

Posted
Yes, that idea had occured to me today on the way into work. Bit of a faff to rename the local printers... usfull if you think of it at the start.

Could you write a script that puled all local printer names to a file then just have a long list of default printers messy but would work

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...