Sorry,
This is just a question for downvotes.
People who ask are simply NOT SURE the problem should be in THIS PART.
eg.
set a= if %a%==1 echo yes
If I just send this line:
if %a%==1 echo yes
Then EVERYONE KNOW THAT THE PROBLEM?
Remember that for a variable, such as% abc%, it is better to use it with ", [or {to prevent an error message.
eg.
set /p abc=
and the user does not enter anything.
Then the following line should be:
if %abc%==1 echo Hi
But it became:
if ==1 echo Hi
as "% abc%" == ""
But with "" he will become
if ""=="1" echo Hi
And "does not match" 1 ".
Got it?
EDIT ---
If you are using Windows 7 (or other versions), you can also try the following:
choice /c YN /n /m "Confirm? [Y^|N]
^ just exits the "pipe" ( | ).
Hope this will be helpful for you!
Jamie
source share