Jump to content

Recommended Posts

Posted

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!

Posted (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 by AJWhite1970
  • Thanks 1
Posted

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!

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...