%systemroot% from registry

G

Guest

How do I obtain the value of the %systemroot% environment variable from the
registry? I looked in the following registry key that is supposed to contain
all the "system" environment variables to no avail:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
Manager\Environment. Actually many of the environment variables listed under
this key are in terms of %systemroot%!

I tried searching in the Microsoft Knowledge Base without much luck.

Thanks for any help!
 
T

Torgeir Bakken \(MVP\)

ND said:
How do I obtain the value of the %systemroot% environment variable from the
registry? I looked in the following registry key that is supposed to contain
all the "system" environment variables to no avail:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
Manager\Environment. Actually many of the environment variables listed under
this key are in terms of %systemroot%!

I tried searching in the Microsoft Knowledge Base without much luck.
Hi,

The SystemRoot value (type REG_SZ) under the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\
 
T

Tom Porterfield

How do I obtain the value of the %systemroot% environment variable from the
registry? I looked in the following registry key that is supposed to contain
all the "system" environment variables to no avail:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
Manager\Environment. Actually many of the environment variables listed under
this key are in terms of %systemroot%!

I tried searching in the Microsoft Knowledge Base without much luck.

Check HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion for
SystemRoot. Better to read the environment variable than querying specific
registry keys for this type of data though as different versions of Windows
source this information differently but it always ends up in environment
variables.
--
Tom Porterfield
MS-MVP Windows
http://support.telop.org

Please post all follow-ups to the newsgroup only.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top