我正在使用简单的批处理脚本来隐藏用户输入的密码。解决方案是创建一个弹出窗口并更改该弹出窗口的文本颜色。以下是代码,它工作正常在其他人的顶部制作cmd窗口
@echo off
Echo Please enter your password in the popup window and then press enter
set tempbat="%temp%\p.cmd"
REM Create temporary batch file to make popup window for entering password 'masked'
echo mode 20,1 >%tempbat%
echo color 01 >>%tempbat%
echo Title Enter Password >>%tempbat%
echo setlocal enabledelayedexpansion >>%tempbat%
echo set /p Pass= >>%tempbat%
echo echo !pass!^>"%temp%\pass.txt" >>%tempbat%
echo exit >>%tempbat%
start /wait "" %tempbat%
del %tempbat% 2>NUL
set /p Pwd=<"%temp%\pass.txt"
del "%temp%\pass.txt" 2>NUL
echo %Pwd%
我唯一担心的是,当弹出窗口出现时,我可以把它总是在主cmd窗口,并主要cmd窗口甚至禁止访问的顶部(我期望的行为像Bootstrap Modal)?
感谢阅读,希望得到帮助从你
使用的畏缩密码的弹出可以是无用的,但如果这是你想要你可以使用CMDOW什么。 http://www.commandline.co.uk/cmdow/ – 2014-10-28 15:51:50
感谢您的建议。但是我的工作只需要纯批处理脚本。我无权使用第三方脚本 – Liverpool 2014-10-29 02:40:23