|
Answer» Hey, i was WONDERING how i could get some batch to run under xp that WOULD need you to put in a certain right value of characters and when asnwer with the right ones starts a file, when not something else i have in mind, see it as a password check, i tryed it myself in a simple way but it didnt work out, any ideas ?Try this code.
Code: [Select]@ECHO OFF SET /P CHOISE="Enter your password here and press enter> " IF "%CHOISE%"=="password" GOTO 1 IF NOT "%CHOISE%"=="password" GOTO 2
:1 (correct)
:2 (incorrect)
Replace password in both IF LINES with your password. Replace correct with whatever you want to happen if the password is typed correctly. Replace incorrect with whatever you want to happen if the password is typed incorrectly.
One disadvantage to my METHOD is the password is not case sensitive.Edited Code
Code: [Select]@echo off echo. echo Enter your password here and press enter. . . set /p a= : if /i %a%==password ( cls echo. echo. Correct password pause exit ) else ( cls echo. echo. Wrong password pause exit ) The password is not case sensitive and people can see what you are typing in.Thanks A Lot ¦} Thats all i NEEDED !
|