I’ve spent my recent hours researching batch scripting and compiling my own program using lua, and batch. One of my batch files isn’t working properly and I have 0 idea why. I have edited the script a bit since then but not anything that would change how it works.
This batch script is making you enter a password when you start it up. When I answer with the correct password it will say ACCESS GRANTED. And when entering it wrong it should say ACCESS DENIED. But what is happening instead is that when I enter the wrong password, it says ACCESS GRANTED. I cannot seem to find why this doesn’t work.
@echo off color A set password=YOUR PASSWORD HERE :start cls echo Welcome! echo Please input password: set /p passwordinput= if %passwordinput%==%password% ( cls color 2 echo ACCESS GRANTED! timeout /t -1 goto access ) else ( cls color C echo ACCESS DENIED echo TRY AGAIN timeout /t -1 cls color a goto start ) :access cls pause
Source: Windows Questions