Hi we are running the script below but when a student is on they get printers from other rooms?

Option Explicit
DIM RegEntry, ComputerName

RegEntry="HKLM\SYSTEM\CurrentControlSet\Control\Co mputerName\ComputerName\ComputerName"
ComputerName = ReadRegValue(RegEntry)

if InStr(1,ucase(ComputerName),"LAB1-",vbTextCompare) > 0 then call SetPrinter("\\LAB1\LaserJet")
if InStr(1,ucase(ComputerName),"LAB2-",vbTextCompare) > 0 then call SetPrinter("\\LAB2\LaserJet")
if InStr(1,ucase(ComputerName),"OFFICE-",vbTextCompare) > 0 then call SetPrinter("\\OFFICE\LaserJet")
'so on and so forth.

' *** This subroutine installs and sets the default printer
Sub SetPrinter(ByVal PrinterPath)
DIM WshNetwork
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection(PrinterPath )
WshNetwork.SetDefaultPrinter Printerpath
end sub

' **** This function returns the data in the registry value
Function ReadRegValue(ByVal RegValue)
Set WSHShell = WScript.CreateObject("WScript.Shell")
On Error Resume Next
ReadRegValue= WSHShell.RegRead(RegValue)
End Function