faza Posted September 13, 2007 Posted September 13, 2007 I am trying to get this printer script to work, but everytime i run it i get an error saying needs End Select. Any advice would be great!!print.txt
paulhyman Posted September 13, 2007 Posted September 13, 2007 are you using vbscript or something ? maybe vba ? and would you have a select case ? if so you need to add the end statment to it. i might be on a totally different track , sorry if i have misunderstood what you mean.
Ric_ Posted September 13, 2007 Posted September 13, 2007 Your first two case statements are missing their closing End Select
paulhyman Posted September 13, 2007 Posted September 13, 2007 you do not have enough end selects you have missed two on the first two select case
paulhyman Posted September 13, 2007 Posted September 13, 2007 arr Ric_ you got there before my second reply. i had not noticed he attached the file on my first post.
faza Posted September 14, 2007 Author Posted September 14, 2007 Whern i run the script now i am getting Error Line 111 Character 2 Error = Expected 'End'print.vbs
Iain Posted September 14, 2007 Posted September 14, 2007 The error is caused by the second Select Case (Left(computerName, 5)). If you get rid of this it should work (as it is identical to the first). E.g. Select Case (Left(computerName, 5)) Case "W107A" WshNetwork.AddWindowsPrinterConnection "\\servername\W107A_in" Case "W107c" WshNetwork.AddWindowsPrinterConnection "\\servername\W107c_in" Case Else ' WScript.Echo "No default printers added" End Select Iain.
Halfmad Posted September 14, 2007 Posted September 14, 2007 I have a similar script that removes printers and then adds new ones based on location (taken from the computers container OU) works a treat here. PM me if you'd like to see it, made with a lot of help from the edugeek folks
faza Posted September 14, 2007 Author Posted September 14, 2007 When i login with a computername e257 i get the printers for e258
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