M
M
Mingun2016-03-26 13:38:24
Windows
Mingun, 2016-03-26 13:38:24

Why isn't the %ProgramFiles% variable expanded inside another REG_EXPAND_SZ variable?

There is such initial data:
In the registry, the JAVA_HOME variable is declared as having the REG_EXPAND_SZ type , the value is %ProgramFiles%\Java\jdk1.7.0_11 .

> echo %ProgramFiles%
C:\Program Files
> echo %JAVA_HOME%
%ProgramFiles%\Java\jdk1.7.0_11

If you add, for example, %SystemRoot%: %ProgramFiles%\Java\jdk1.7.0_11\%SystemRoot% to the JAVA_HOME variable and restart the console, then

> echo %SystemRoot%
C:\Windows
> echo %JAVA_HOME%
%ProgramFiles%\Java\jdk1.7.0_11\C:\Windows

Question: Why did n't %ProgramFiles% expand? Where is the ProgramFiles variable itself stored ? Searching the registry for a key with that name didn't turn up anything that looked like environment variables. However, searching for SystemRoot also does not give anything, but nevertheless it is revealed.
System -- Windows Vista SP1
MSys-ovsky uname issues
MINGW32_NT-6.0 VISTA-NOTEBOOK 1.0.12(0.46/3/2) 2011-07-20 17:52 i686 unknown

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question