M
Mr. Novice
When I run the script listed below I get "goto was
unexpected at this time".
echo The question.
echo 1. option 1
echo 2. option 2
set /p var=pick your option
if "%var%"=="1" set var2=string1&goto label
if "%var%"=="2" set var2=string2&goto label
I searched a google newsgroup and saw that Phil had
suggested changing things up a bit so I tried things
like...
if [%var%]==[1] set var2=string1&goto label
if {%var%}=={1} set var2=string1&goto label
if [%var%]==[1] set var2=string1&goto :label
if "%var%"=="1" (
set var2=string1
goto label
)
I even tried taking out the set command...
if "%var%"=="1" goto label
but haven't had any luck. Any suggestions?
Chad
unexpected at this time".
echo The question.
echo 1. option 1
echo 2. option 2
set /p var=pick your option
if "%var%"=="1" set var2=string1&goto label
if "%var%"=="2" set var2=string2&goto label
I searched a google newsgroup and saw that Phil had
suggested changing things up a bit so I tried things
like...
if [%var%]==[1] set var2=string1&goto label
if {%var%}=={1} set var2=string1&goto label
if [%var%]==[1] set var2=string1&goto :label
if "%var%"=="1" (
set var2=string1
goto label
)
I even tried taking out the set command...
if "%var%"=="1" goto label
but haven't had any luck. Any suggestions?
Chad