I need to prompt for a username and password from a batch script subroutine and I have the following requirements:
- Must be user-friendly (i.e. not on the command line, but from a
dialog box). - Must mask the password.
- Must not require customized settings or installation before I run the batch script (no AutoIT or odd IE settings).
- Must be compatible with Windows XP, 2008, and 7 (though if variations on a theme are appropriate I can check the specific OS).
I’m assuming that I may need to use VBscript, which I can easily create from within the batch script and then delete afterward. I did find this link, with two different VBScript options, but the first one violates requirement 1 (console based), and the second violates requirement 3 (default IE settings aren’t allowing dynamic content these days). Any other ideas?
HTML Applications might work for you. You could create a simple page with an
<input type="password" />control. I can’t think of a good way to get the password from the HTA back to the batch file, though, other than writing the password to a temporary file, or maybe a registry key.