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

logon script to add printers

Status
Not open for further replies.

weckev

MIS
Aug 23, 2004
5
0
0
US
I am trying to add printers to XP clients using logon scripts on a 2000 Server PDC. The logon script already maps drives so the set up is correct. The syntax doesn't do anything.

I'm not using any special scripting tools. Just editing the existing .bat file with notepad.
I've tried

net use lpt1: \\servername\printershare

and

Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection "\\PrintServer1\printershare"
WshNetwork.SetDefaultPrinter "\\PrintServer1\printershare"

with no luck. The print server is different from the PDC and I have been able to map a drive to the print server, so the connection is good.
 
this may help. quoted from
How to setup a default printer based on a network group

' Add a network printer if the computer is a member of the group.
' Make this printer the default.
If IsMember(objComputer, "information_system") Then
objNetwork.AddWindowsPrinterConnection "\\chicagotech\cc041hp4050"
objNetwork.SetDefaultPrinter "\\chicagotech\cc041hp4050"
End If


Robert Lin, MS-MVP, MCSE & CNE
Windows, Network, Internet, VPN, Routing and How to at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top