jamesas Posted July 28, 2004 Share Posted July 28, 2004 hey i would like to know how to add a printer in the logon script Link to comment Share on other sites More sharing options...
Aaron P Posted July 29, 2004 Share Posted July 29, 2004 Two ways to do this: 1. Command Script (Batch File): Use rundll32 printui,PrintUIEntry, run rundll32 printui,PrintUIEntry /? to see available options, which include adding printers, removing printers and setting the default printer. rundll32 printui,PrintUIEntry /in /n\\SERVER\PRINTERSHARE 2. VBScript. Listed below are three functsion you can use for adding printers, removing printers and setting the default printer. Function fnRemoveAllPrinterConnections (ServerName) Dim i, oPrinters Set oPrinters = WshNetwork.EnumPrinterConnections For i = 0 to oPrinters.Count - 1 Step 2 If InStr(UCase(oPrinters.Item(i+1)), UCase(ServerName)) Then WshNetwork.RemovePrinterConnection oPrinters.Item(i+1) End If Next Set i = Nothing Set oPrinters = Nothing End Function ' -------------------------- Function fnAddPrinterConnection (PrinterPath) WshNetwork.AddWindowsPrinterConnection PrinterPath End Function ' -------------------------- Function fnSetDefaultPrinter (PrinterPath) WshNetwork.SetDefaultPrinter PrinterPath End Function Link to comment Share on other sites More sharing options...
Recommended Posts