Click here to Skip to main content
15,881,600 members
Please Sign up or sign in to vote.
1.33/5 (2 votes)
See more:
I have been trying to make a password in batch coding and when you type in the password it shows the password so it is not as safe. Any Ideas?
Posted
Comments
[no name] 11-Jul-13 12:36pm    
I do not think your question, if there is one, is very clear but see if http://stackoverflow.com/questions/664957/can-i-mask-an-input-text-in-a-bat-file helps.

1 solution

This is very simple. Use the code below to make a password


<br />
@echo off<br />
set password=password<br />
set /p input=What is the password?: <br />
if %input%==%password% (<br />
echo your right!<br />
echo The password was %input%<br />
rem Note: You can replace %input% with %password%. They are the same!<br />
pause<br />
exit<br />
) else (<br />
echo Wrong password!<br />
echo Goodbye!<br />
pause<br />
exit<br />
)<br />


EDIT----------------------
I know see what you meant. I dont think this is exactly possible, maybe using choice commands
like with every letter. Sorry about the bad answer. But do something like choice EVERYLETTER Than have the prompt add a star when they hit a letter. I believe this will work. This would be the only known method I know of.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900