Hello, I'm extremely new to scripting and was seeing if i could get some help. I'm tasked with setting networked printers as global printers on community computers. I think i got the script down but my error handling is off and i'm not sure where to start. As for the script i have it set to have a pop up box come up and they type in the printer name then it runs the rundll32 printui.dll command. Here is my script. Let me know what you guys think and any help is appreciated.
On Error Resume Next
Dim objNet, strPrinter
Set objNet = CreateObject("Wscript.Network")
strPrinter = InputBox("Please enter the name of the Printer you'd like to add", "Add Printer", "eg. printer name")
Set objShell = CreateObject("WScript.Shell")
arrServers = Array("vps01","vps02")
For Each strServer In arrServers
strCommand = "cmd /c rundll32 printui.dll,PrintUIEntry /ga /n\\" & strServer & "\" & strPrinter
objShell.Run strCommand, 1, True
Next
If err.number = 0 Then
Wscript.Echo strPrinter & " added!"
Else
Wscript.Echo "Uh oh - there seems to be a problem! Error Code : " & err.number & " Error Description: " & err.description
End If