The system is 2k
set /p con="Continue (Y/N):"
set con=%con:y=Y%
set con=%con:n=N%
if %con%==Y goto continue
if %con%==N goto out
Written in a cmd script, while the program is running, echo %con%
I found that con at this point is y=Y
That is to say, con is now equal to the expression y=Y
Then when if does the check it becomes if y=Y==Y goto continue
But this line gives a syntax error in 2003, and I don't know why
Also, after executing set con=%con:y=Y% at the command line
echo %con% at this point con is equal to Y
Why does the command behave differently at the command line and in a script?
set /p con="Continue (Y/N):"
set con=%con:y=Y%
set con=%con:n=N%
if %con%==Y goto continue
if %con%==N goto out
Written in a cmd script, while the program is running, echo %con%
I found that con at this point is y=Y
That is to say, con is now equal to the expression y=Y
Then when if does the check it becomes if y=Y==Y goto continue
But this line gives a syntax error in 2003, and I don't know why
Also, after executing set con=%con:y=Y% at the command line
echo %con% at this point con is equal to Y
Why does the command behave differently at the command line and in a script?
