I am working on simple batch script to hide the password inputted by user. The solution is to create a popup and change text-color for that popup. Following is the code and it works properly
@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%
My only concern is that when the popup occurs, can I set it always on top of main cmd window, and even disable access to main cmd window (I expect the behavior like Bootstrap Modal)?
Thank for reading and hope to receive helps from you