There was a question asked here with the same title, but I don't understand what it was talking about.
All I'm trying to do is see if the end-user is putting in vaguelly the same text. This will also be used in a following menu. but all I need to know is how to do it.
Image Capture of progam running (Example of Menu)
All I'm trying to see if the string named %scamble% contains "Yes", "Y", "No", or "N" without having to use a ton of if statements. Again I have no idea what I'm doing... I learned this all self-taught. So treat me as a curious noob.
like
echo This is a ONE TIME prompt (for this session ONLY).
set /p scramble=Y/N: || set scramble=Y
for /f "text=," %%a in (%scamble%) do (
set string = %%a
if "!string:%substring%=!"=="!string!" (
echo Found!
)
)
Again I must reiterate, that I have no clue what I'm doing, but I think I may somewhat understand something. So I ask you, people of the internet, please help! Thanks.
set string = %%adefines a variable with a name ending with a space character, and a value beginning with one too. You should change it toset "string=%%a". Whilst you're at it, you may as well useset /p "scramble=Y/N: "andset "scramble=Y"too.for /f "text=,"and you should decide whether you are working with the variablescrambleor withscambleset /?,for /?,if /?, then press the[ENTER]key to read it.set /Pfor a Yes/No prompt, use the command CHOICE for such a prompt. See: How can I make an "are you sure" prompt in a Windows batch file?