1.

Solve : Password in a batch file?

Answer»

hi, i would like to know how to make a batch file, with a password, so if you OPEN it, you are ASKED a password, if it is CORRECT, you can continue, but if your wrong, on the 3th time, you will ext and the computer will be shut down,
but how to ask a password?

last piece would be:
exit
shutdown -sMy track record today is miserable so you may want to wait for a better answer.

Code: [Select]
@echo off
set Count=0
:loop
set /a Count=%Count%+1
set /p var=Enter Password:
if /i %var%==password goto OK
if %Count% EQU 3 goto shutdown
goto loop

:ok

:shutdown


You might be able to conjure up something with a FOR /L statement but I kept having SCOPE problems with this.

Happy Computing. tnx man.



Discussion

No Comment Found