HOME
Stephen Knight
10/20/2009
09:36 AM
Password entry obscured from batch file
Type:
VBScript, Batch/Command file
Category:
Password
These scripts show some ways of prompting for a hidden password within a batch file so that it can be returrned in a variable for authenticating with other commands, e.g. as part of creating an automated FTP script requiring the user to enter their password rather than incorporate it in the script.
This script is a variation on the one below which I have been using for a while to obscure output using built in commands to change console colour etc. This goes one further and sets the foreground and background colours to completely hide the text which is not possible using the built in command. This makes the script XP only though without pre-creating a .REG file to import using REGEDIT as Window 2000 and before did not have the REG.EXE command. There is a version in the code section below which creates a .REG file on the fly.
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/Q_24713227.html?cid=1135#a25277510
There is also a matching non-obscured username prompting box here:
Code
Explanation
Examples
Attachments