1.

Solve : Checking a list ...?

Answer»

How do I CHECK to see if the %INSTANCE% entered by a user exists in space separated VARIABLE ....

[highlight]set BOS-Instances=demo live qa train[/highlight]

Not entirely sure how to write what I suspect will be a FOR routine to handle this. If the %Instance% entered does not exist in the LIST, then I'll have it exit the script.

Thanks in advance.You NEED to effort a little bit more.
You can do it with the old FOR of MS-DOS

Code: [Select]@echo off
set BOS-Instances=demo live qa train

set Instance=
set /P Instance="Option: "
for %%x in (%BOS-Instances%) do if /I "%Instance%" EQU "%%x" goto GOOD

:BAD
echo Bye
goto :eof

:GOOD
echo Value: %Instance%



Discussion

No Comment Found