%systemroot% from registry

  • Thread starter Thread starter Guest
  • Start date Start date
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!
 
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\
 
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.
 
Back
Top