zag Posted September 18, 2013 Posted September 18, 2013 Has anyone got a simple connect to a shared printer script please? Not having much luck with Group Policy, so I figure just running a logon script might be easier!
AJWhite1970 Posted September 18, 2013 Posted September 18, 2013 (edited) printer.vbs On Error resume Next set objNetwork = WScript.CreateObject("WScript.Network") set objShell = WScript.CreateObject("WScript.Shell") 'Add Network printers objNetwork.AddWindowsPrinterConnection "\\quartz\HP LaserJet P2015 BG02" objNetwork.AddWindowsPrinterConnection "\\quartz\Kyocera FS-3540MFP MATHS" 'Set Default Printer objNetwork.SetDefaultPrinter "\\quartz\HP LaserJet P2015 BG02" Regards Andrew Edit: Forgot to say, ours is called using "cscript \\quartz\profiles\printers\vbs\%computername%.vbs" and we have one vbs script per workstation, so we can easily change the association of a printer from machine to machine Edited September 18, 2013 by AJWhite1970 1
fiza Posted September 18, 2013 Posted September 18, 2013 We use con2prt with a location variable as we need to map different printers depending on location. PeteNetLive - KB0000510 - Windows - Location Based Printing with con2prt 1
spacehopper Posted September 25, 2013 Posted September 25, 2013 we have been using con2prt with an environment variable for years.. however... ive just been looking at some windows 7 machines that are using this system.. (weve had win7 machines in school now for over a year..) and con2prt is crashing the print spooler meaning the printers arent added.. has anyone else experienced this? and if so what did you do to remedy it? Thanks!
mavhc Posted September 25, 2013 Posted September 25, 2013 What's the server running the spooler's OS?
mavhc Posted September 25, 2013 Posted September 25, 2013 I read the computer's OU to work out printer settings: Set objSysInfo = CreateObject("ADSystemInfo") Set objWshNetwork = CreateObject("WScript.Network") strNameStr = objSysInfo.ComputerName ' Get the computer name which contains the full path to the root arrSplitArray = split(strNameStr,",") ' Split the string into components strSchoolOUName = mid(arrSplitarray(4),4) ' Get the School Name without the OU= prefix strRoomOUName = mid(arrSplitarray(1),4) ' Get the Room without the OU= prefix
spacehopper Posted September 25, 2013 Posted September 25, 2013 the server they're connecting to is server 2003... however.. con2prt is crashing the windows 7 machines local spooler..
mavhc Posted September 26, 2013 Posted September 26, 2013 the server they're connecting to is server 2003... however.. con2prt is crashing the windows 7 machines local spooler.. It's probably Print Ports and Drivers may not displayed on a computer that is running Windows 7 I set up a GPO, computer, preferences, windows settings, registry item to fix it
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now