way to encrypt or not display text when writing in CMD.
way to encrypt or not display text when writing in CMD.
Lately it can not be done directly, you must resort to either an auxiliary script, or use the powershell.
This solution uses the second option, but since cmd
password.bat
powershell -Command $password = read-host "Ingrese password: " -AsSecureString ; ^
$BSTR=[System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($password) ; ^
[System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR) > .tmp.txt
set /p password=<.tmp.txt & del .tmp.txt
echo %password%