I have some env variables like ANSYS009_DIR
ANSYS110_DIR
ANSYS120_DIR
As you can see the difference is the number among them. I want to write a batch file and first check if one of these variables exits. I know that this code will do that for one variable
IF "%ANSYS110_DIR%" == "" GOTO NOPATH
:YESPATH
@ECHO The PATH environment variable was detected.
GOTO END
:NOPATH
@ECHO The PATH environment variable was NOT detected.
GOTO END
:END
However I want to know how can I use wild char?? For example %ANSYS*_DIR% doesn't work.
please share any suggestion on that

I think the problem is that the variable is defined exactly. I dont think that there is an option to wildcard a variable, becuase of this. the %ANSYS*_DIR% counts as a variable, and as you havent defined it, it wont work. you might be able to pipe the "path command into a text file and look through that? mike
i ment set sorry mike
ok for few variables it is possible to do a brute force check. I was seeking a general solution for that.
