T3RRYT3RR0R

Batch - Hide input

Oct 6th, 2020
398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.37 KB | None | 0 0
  1.  
  2. @echo off
  3. ::: Adapted from: https://stackoverflow.com/a/24792070/12343998
  4. Set "HideInput=For %%n in (1 2)Do if %%n==2 ((set /P "=_" < NUL > "!Str!" & findstr /A:1E /V "^$" "!Str!" NUL > CON) && del "!Str!" & set /P "#=")Else Set Str="
  5. Setlocal EnableDelayedExpansion
  6. %HideInput:#=PW%Enter Password
  7. cls
  8. color 07
  9. echo The password entered is: "%PW%"
  10. Endlocal
  11.  
  12.  
  13.  
  14.  
  15.  
Add Comment
Please, Sign In to add comment