Here is the validation code:
VBScript Code
Double-click the code block to select all.Do strNewDefaultPrinter = InputBox(BuildMenu, "Select a New Default Printer") If IsEmpty(strNewDefaultPrinter) <> False Then WScript.Echo "You must make a selection." strGoodInput = False ElseIf IsNumeric(strNewDefaultPrinter) <> True Then WScript.Echo strNewDefaultPrinter & " is not a valid number. Try again." ElseIf strNewDefaultPrinter > UBound(arrInstalledNewServerPrinters)+1 Then WScript.Echo "Your selected value is too high. Try again." strGoodInput = False ElseIf strNewDefaultPrinter < 1 Then WScript.Echo "Your selected value is too low. Try again." strGoodInput = False Else strGoodInput = True End If Loop Until strGoodInput = TrueBuildMenu is a Sub I use to build a selection menu of currently installed printers numbered 1 through x, strGoodInput is initialized as True and is set to False if any of the validation checks fail. The user is prompted to enter the number corresponding to the printer listed in the menu.
If you need more of the code let me know, but this snippet should be good enough to get the idea across.