@echo off
setlocal enabledelayedexpansion
:BEGIN
echo cd "folder one" = navigates user to folder 1.
set "item1=cd "folder one""
set /p "input=Insert Word: "
if /i "!input!" == "!item1!" (goto 2) else goto BEGIN
:2
echo you did it^^!
timeout /t 05
exit /b
Delayed expansion of variables can help with these cases,
as pre-expanded variables are expanded literally into the
source prior to execution. Delayed expansion stores the value
in memory and compares the value direct at execution.
To ensure correct comparison, both sides may need to be delayed
expansion to avoid special character such as double quotes.
Both sides may not need the outer double quotes as it does not
suffer the literal syntax error issues of the pre-expanded
variables. I chose to add the outer double quotes.
You may need to disable delayed expansion if you use
pre-expanded variables at expand time, that may contain
exclaimation marks, and enable after that time to expand
the delayed expanded variables.
View setlocal /?
about the use of enabledelayedexpansion
and disabledelayedexpansion
.