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!!
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!!
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.

Your first two case statements are missing their closing End Select
you do not have enough end selects
you have missed two on the first two select case
arr Ric_ you got there before my second reply. i had not noticed he attached the file on my first post.
Whern i run the script now i am getting
Error
Line 111
Character 2
Error = Expected 'End'
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.
Iain.Code: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
Yes thank you very much!
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![]()
When i login with a computername e257 i get the printers for e258
There are currently 1 users browsing this thread. (0 members and 1 guests)