batch-filepasswords

Batch file: Password Stars/Circles


Like you already know, websites have certain special chars for passwords, like stars and circles.

Could this be possible in a batch file, on the following one:?

If this is not possible, if you type it in, could you just see nothing?

set pass=
set /p pass=Enter your password: 
if {%pass%}=={} goto :begin
set authenticated=
for /f "tokens=*" %%a in (pass.txt) do (
    if {%%a}=={%pass%} set authenticated=true
)
if not defined authenticated (echo Invalid password & goto :begin)

But i need to get this in it:

for /f "delims=" %%i in ('cscript /nologo GetPwd.vbs') 

HOW!


Solution

  • Another potential alternative is an open-source tool I wrote:

    https://github.com/Bill-Stewart/editenv/

    editenv --maskinput --prompt "Password: " PWD
    

    Note that this doesn't provide security, as (in this example) the content of the PWD environment variable is clear-text. Still, it does provide input masking in cases where this might be useful.