Batch program - password protect and open program
I wrote a batch program to open a program depending on a right or wrong password:
Code:
cls
@echo off
set passWord = samplepassword
goto CHECK
:CHECK
echo SUP HOMIE:
set/p "pass=>"
if %pass%==%passWord% goto OPEN
goto END
:OPEN
echo Right Password...
@START "C:\Program Files\SampleProgram\SampleProgram.exe"
goto END
:END
echo closing...
pause
It doesn't work, though. No matter what you type in as the password, it goes to END. Before, when I was messing with it, I got it to OPEN, but it went to OPEN no matter what the user inputted. And, what opened was not the program, just a command prompt with the address of the program in the title.
Any ideas?
Thou com'st in such a questionable shape
Hamlet, Act 1, Scene 4
Bookmarks