|
|
Your IP Address is 38.107.191.92 | |
|
"Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives."
-- William A.Foster
|
|||
|
Blog: dave
Created by David Smith
Last post Wed 12 of March, 2008 10:13 EST (1 Posts | 319 Visits | Activity=2.00)
em Printer Mapping Script
rem printers.vbs Const NetworkMapped? = "\\" On Error Resume Next Set objNetwork = CreateObject("WScript.Network") Set colPrinters = objNetwork.EnumPrinterConnections For i = 0 to colPrinters.Count -1 Step 2 strPrinterName = colPrinters.Item(i) strPrinterUNC = colPrinters.Item (i + 1) If Left(strPrinterUNC,2) = NetworkMapped? Then objNetwork.RemovePrinterConnection(strPrinterUNC) Next 'And now to map the required printers 'Capture the Computer name, take the first 5 characters to determine the classroom 'Then map the relevant printers for that classroom strComputerName = Left(objNetwork.ComputerName, 5) Select Case strComputerName Case "DAVID" objNetwork.AddWindowsPrinterConnection "\\saturn\colour" objNetwork.SetDefaultPrinter "\\saturn\colour" End Select
|
LoginMost read topics
Top articles
|