Listing 1: SetPrinter.vbs BEGIN COMMENT ' Tell the script to recognize only defined variables, then ‘ define those variables. END COMMENT Option Explicit Dim oNetwork, sPrintPath, sShort BEGIN COMMENT ‘ Associate a variable with the WshNetwork object. END COMMENT Set oNetwork = CreateObject("WScript.Network") BEGIN COMMENT ‘ Select the three leftmost characters from the value that the ‘ ComputerName property returns, and assign those characters ‘ to the sShort variable. END COMMENT ‘ BEGIN CALLOUT A sShort = Left (oNetwork.ComputerName, 3) ‘ END CALLOUT A BEGIN COMMENT ‘ Compare the contents of sShort with several values. END COMMENT Select Case sShort Case "Lib" sPrintPath = "\\server\printer1" Case "Lab" sPrintPath = "\\server\printer2" Case “Rec” sPrintPath = "\\server\printer3" Case Else WScript.Quit End Select BEGIN COMMENT ‘ Add the printer connection. END COMMENT oNetwork.AddWindowsPrinterConnection sPrintPath BEGIN COMMENT ‘ Set the default printer. END COMMENT oNetwork.SetDefaultPrinter sPrintPath