Can I define a Windows (XP) environment variable in terms of another environment variable?

Posted by Yaneeve on Super User See other posts from Super User or by Yaneeve
Published on 2010-01-04T11:14:19Z Indexed on 2010/03/16 19:21 UTC
Read the original article Hit count: 244

I wish to define two environment variables as follows:

PROGRAM_HOME=P:
JAVA_DIR=%PROGRAM_HOME%\Java

Obviously the following works:

dir %PROGRAM_HOME%

But, the following doesn't:

dir %JAVA_DIR%

What should I do in the case I do wish to define JAVA_DIR in terms of PROGRAM_HOME?

EDIT: removed \ (it had been a typo)

PROGRAM_HOME=P:\ ==>PROGRAM_HOME=P:

© Super User or respective owner

Related posts about windows-xp

Related posts about environment-variables