Scripting to add printers to a computer group

fahmi1

Beta member
Messages
1
Location
USA
Hey guys.
At my school we have 2 printers in our media center than the media center teacher is very picky that the B&W printer be the default printer. Because I cant find a way to (by computer group not user) add both printers and make the B&W a default printer in GPO I have found the need/workaround to script both printers to be added and have the scripts run form the reg. when the student logs in.

The following 2 scripts are running from the C:\windows folder

For the b&w printer

Set WshNetwork = CreateObject("WScript.Network")
PrinterPath = "\\gcprint01\MediaCenterB&W"
PrinterDriver = "Lanier LP37N PCL 6"
WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
WshNetwork.SetDefaultPrinter \\gcprint01\MediaCenterB&W



For the color printer

Set WshNetwork = CreateObject("WScript.Network")
PrinterPath = "\\gcprint01\MediaCenterColor"
PrinterDriver = "HP Color LaserJet 3500"
WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
WshNetwork.SetDefaultPrinter \\gcprint01\MediaCenterB&W



Here is my reg file I added

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"BW Printer Script"="C:\\windows\\Printer Scripts\\BWPrinter.vbs"
"Color Printer Script"="C:\\windows\\Printer Scripts\\Colorprinter.vbs"



My problem is that Some of the computers randomly dont connect to the color printer and are duplicating the b&w Printer. Can anyone find any fault here or something im missing. I am fairly new to scripting so please forgive me if its a stupid mistake.

 
Back
Top Bottom