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!

mapping printer via logon script

Status
Not open for further replies.

OLDMO

MIS
Aug 13, 2003
95
0
0
US
Does anyone know the syntax to do this.

Would it be the same as doing it in the command prompt?
 
The quickest and easiest script is:

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

Just change the printserver name and the printer name.

 
Try this.

Best way is through a logon script/batch file.

Use rundll32

rundll32 printui.dll,PrintUIEntry /in /c(UNC path of print server) /n(UNC path of printer on print server)


FOR SYNTAX
rundll32 printui.dll,PrintUIEntry /?

Some lead, some follow....I just Hope!
 
net use will work, but that only redirects a port, it doesn't actually install the printer. You can find a utilility called con2prt.exe on the resouce CD. This will install any network printer for you as long as the printer driver on the server is compatible with your desktop OS.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top