CMD hide text when writing [closed]

0

way to encrypt or not display text when writing in CMD.

    
asked by Cristian Zauco 28.06.2017 в 17:54
source

1 answer

1

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%
    
answered by 30.06.2017 / 22:30
source