I'm trying to create a script that maps shared printers to a specific workstation regardless of who logs in. I have an error on Line 2 Char 14 of the following script:
Option Explicit
Dim objNetwork,
sPrintPath,objPrinter,strComputer,objWMIService,colItems,objItem
Set objNetwork = CreateObject("WScript.Network")
' Begin Callout A
Select Case oNetwork.ComputerName
Case "sand-234-a"
sPrintPath = "\\sb-fs1\sand-234-1022n"
Case "sand-234-nc01"
sPrintPath = "\\sb-fs1\sand-234-1022n"
End Select
' End Callout A
oNetwork.AddWindowsPrinterConnection sPrintPath
oNetwork.SetDefaultPrinter sPrintPath
There will be more printers once I get it working. I cannot figure out what I'm missing??
Option Explicit
Dim objNetwork,
sPrintPath,objPrinter,strComputer,objWMIService,colItems,objItem
Set objNetwork = CreateObject("WScript.Network")
' Begin Callout A
Select Case oNetwork.ComputerName
Case "sand-234-a"
sPrintPath = "\\sb-fs1\sand-234-1022n"
Case "sand-234-nc01"
sPrintPath = "\\sb-fs1\sand-234-1022n"
End Select
' End Callout A
oNetwork.AddWindowsPrinterConnection sPrintPath
oNetwork.SetDefaultPrinter sPrintPath
There will be more printers once I get it working. I cannot figure out what I'm missing??