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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to Set Default Printer (for certain computers)

Status
Not open for further replies.

ryhackl

Instructor
Sep 5, 2002
40
CA
I have successfully assigned logon scripts to let all users print to certain printers, BUT I need to modify the script so that when users log on to specific computers (ex/ library computers) they will ONLY print to the library printer.

I have both printers installed on each of the library computers, but (due to the logon script), the "computer lab" printer is the default. Most users forget to switch to the library print server, so we get alot of duplicate printing.

My specific need (for the .vbs logon script): when I log on to "Library1", set default printer to "LibraryPrinter". I need this to be done based on computer name, not username...

Any help would be appreciated...

- Ryan
 
Thanks for the quick response! Is KixTart easy to use (I'd rather not learn another programming language besides .vbs scripting)

In Microsoft WinNT4, there was a command called Con2prt. Is this generic for all operating systems, or just WinNT4?

- Ryan
 
Kixtart is a breeze. It's more or less like a combo between Basic and VB.

You'll have *no* problem picking it up. There are dozens of kixtart resources.

Regarding con2prt... I'm not sure.
 
why not just implement a batch file in the 'All Users' profile startup to 'unmap' the existing printers and 'map' the library printer?
 
KCDave03

Can I do that in the GPO logon script?
 
KCDave03

Or is it better to put it in the "Startup" folder??
 
What I would like to do is set an

IF computername = Library** (as in Library01, Library02, etc)
THEN Print on LibraryPrinter
ELSEIF computername = Lab** (as in Lab01, Lab02, etc)
THEN Print on LabPrinter


Suggestions?
 
Con2prt is a third party app, just try /? for list of arguments. Can be used OK but was cmd tool not vbs tool.
As for vbs, I would say first delete any exiting printers then add specific printers based on machine names, subnets, user groups. ect.
Remove
Set WshNetwork = WScript.CreateObject("WScript.Network")
WshNetwork.RemovePrinterConnection "\\PrintServer\PrintName"

Connect
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection "\\PrintServer1\PrintName"
WshNetwork.SetDefaultPrinter "\\PrintServer1\PrintName"
Good Luck





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top