Rob van der Woude's Scripting Pages

Help text for InputBox.cs

(view help text of InputBox.cs as plain text)

InputBox,  Version 1.33
Prompt for input (GUI)

Usage:   INPUTBOX  [ "prompt"  [ "title"  [ "default" ] ] ] [ options ]

Where:   "prompt"    is the text above the input field (use \n for new line)
         "title"     is the caption in the title bar
         "default"   is the default answer shown in the input field

Options: /A          accepts ASCII characters only (requires /M)
         /B          use standard Black and white in console, no highlighting
         /H:height   sets the Height of the input box
                     (default: 110; minimum: 110; maximum: screen height)
         /L[:string] use Localized or custom captions (see Notes)
         /M:mask     accept input only if it matches mask
         /N          Not filtered, only doublequotes are removed from input
                     (default: remove & < > | ")
         /P          hides (masks) the input text (for Passwords)
         /R:regex    accept input only if it matches Regular expression regex
         /S[:text]   inserts a checkbox "Show password" (or specified text)
         /T[:sec]    sets the optional Timeout in seconds (default: 60)
         /W:width    sets the Width of the input box
                     (default: 200; minimum: 200; maximum: screen width)

Example: prompt for password
InputBox.exe "Enter your password:" "Login" /S

Example: fixed length hexadecimal input (enter as a single command line)
InputBox.exe "Enter a MAC address:" "MAC Address" "0022446688AA"
             /M:">CC\:CC\:CC\:CC\:CC\:CC" /R:"[0-9A-F]{2}(\:[0-9A-F]{2}){5}"

Notes:   For hidden input (/P and/or /S), ), "default" will be ignored.
         Be careful with /N, use doublequotes for the "captured" result,
         or redirect the result to a (temporary) file.
         Show password (/S) implies hiding the input text (/P).
         Use /M (without mask) to show detailed help on the mask language.
         Use /L for Localized "OK" and "Cancel" button captions.
         Custom captions require a string like /L:"OK=caption;Cancel=caption"
         (button=caption pairs separated by semicolons, each button optional)
         Text from input is written to Standard Output only if "OK" is clicked.
         Return code is 0 for "OK", 1 for (command line) errors, 2 for
         "Cancel", 3 on timeout, 4 if no regex or mask match.

Credits: On-the-fly form based on code by Gorkem Gencay on StackOverflow:
         http://stackoverflow.com/questions/97097#17546909
         Code to retrieve localized button captions by Martin Stoeckli:
         http://martinstoeckli.ch/csharp/csharp.html#windows_text_resources

Written by Rob van der Woude
http://www.robvanderwoude.com

page last uploaded: 2017-03-25, 21:31