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

Shared Printer

Status
Not open for further replies.

mkshankarg

IS-IT--Management
Feb 9, 2005
21
0
0
AU
Hi guys,

I have a shared printer on my windows 2003 server. I would like to add this printer as the default printer to all my windows xp clients. I have tried adding the printer manually in the clients. But sometimes the default printer does not show up and I have browse for it and add it. Is there any way I can add the shared printer automatically as the default printer when clients logon ? If it is via a logon script, I donot have any logon scripts running. If possible can i have the script too.


 
Take a look here there's loads of info.


This is the code your looking for.

Dim net
Set net = CreateObject("WScript.Network")
net.AddWindowsPrinterConnection "\\ServerName\PrinterName"



I don't mean to sound bitter, cold, or cruel, but I am, so that's how it comes out - Bill Hicks
 
I actually use slightly different code to that, this will add it as the default printer too.


Set Network = CreateObject("Wscript.Network")

Network.AddWindowsPrinterConnection "\\server\printer"
Network.SetDefaultPrinter "\\server\printer"


I don't mean to sound bitter, cold, or cruel, but I am, so that's how it comes out - Bill Hicks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top