Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prompt for default printer

Status
Not open for further replies.

snootalope

IS-IT--Management
Jun 28, 2001
1,706
US
Expanding on the question another user asked in this thread - thread329-1237916 - Is it possible for a script to query which printers are installed and prompt the user to choose between them to set the default?
 
Sure it is. You would just query wmi to get all the available options, present the user with a list, get the response, then set the default.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Great! And you make it sound so easy.. I'm not a programmer in anyway, don't suppose you could tell me how to do this? I'm currently running through a slew of google hits, but it's all greek to me.

To be more specific, I'm using a batch file to check active directory for group membership, that in return calls a vbs script to connect a network shared printer (\\serer\printer) - so I'd need to have a separate vbs script run last that does the query after the printers have been mapped.

Can you help me?
 
Here is the way that I would do it:

Create an HTA
In the OnLoad event for the window:
have it query WMI to determine the available printers
Create a radio button that corresponds to each printer
Have it create a submit button
in the OnClick event of the submit button:
Do go through the collection of printers that you got from the previous query and set the proper one as default


[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top