I have this batch program. I want a verification system where you type the code, and it lets you continue. If you type the wrong code it won't let you continue.
Anyone got some code I can use for this?
I have this batch program. I want a verification system where you type the code, and it lets you continue. If you type the wrong code it won't let you continue.
Anyone got some code I can use for this?
say if you wanted the password to be "1234" you would put:
@echo off
echo Enter the correct code:
set /p InputPass=Code:
if '%InputPass%'=='1234' goto :AccessGranted
goto :AccessDenied
:AccessGranted
cls
echo Access Granted!
timeout 3 /nobreak >nul
goto :continue
:AccessDenied
cls
echo Access Denied!
echo Program on halt!
pause >nul
goto :AccessDenied
:continue
And then you would put in the code you want to execute if the user got it right, under the last line (which says :continue)