Rob van der Woude's Scripting Pages

Help text for HideInput.cs

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

HideInput,  Version 1.01
Batch utility to read 1 line of input while hiding what's being typed, by
temporarily setting the console foreground color equal to its background color

Usage:  FOR /F "tokens=*" %%A IN ('HIDEINPUT') DO SET password=%%A
   or:  FOR /F "tokens=*" %%A IN ('HIDEINPUT /C') DO SET password=%%A

Where:  /C  Clears the screen to remove what's typed from the screen buffer

Notes:  Even though invisible while typing, typed input will be "visible" in
        the screen buffer. The "invisible" text can be made visible with
        Windows' own COLOR command, or by any program that can access the
        screen buffer. To prevent this, use the program's /C switch or
        Windows' own CLS command to clear the screen and screen buffer.
        Return code ("errorlevel") is 0 if valid input is received, 1 in case
        of (command line) errors, 2 if input is empty or whitespace only.

Written by Rob van der Woude

page last uploaded: 2017-02-23, 10:59