Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Returning windows directory 2

Status
Not open for further replies.

elziko

Programmer
Nov 7, 2000
486
0
0
GB
Is there a function that will return the name of the directory that windows was intalled to?

Thanks

elziko
 
Thanks, Chip. I found most of the system variables in
[tt]
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment[/tt]
and[tt]
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\...
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Control\...[/tt]

NT doesn't mind if you modify these at the cmd.exe prompt (luckily, the changes only last for the current cmd session). I wonder how Windows would respond if these variables were modified through the registry...

Well, I believe you are right. There probably isn't a practical way to restrict access to the settings.

Neat thought, though.

VCA.gif

Alt255@Vorpalcom.Intranets.com

"What this country needs is more free speech worth listening to."[tt]
Hansell B. Duckett[/tt]​
 
Alt -

I thought for sure that the user portion was stored under HKEY_CURRENT_USER. Maybe on Win2k -- I'll check when I get home tonight (I'm on NT 4 at work).

But it's good that you found the system variables -- probably should only use the ones under "Current Control Set". The others are probably for other system configurations (left over from Windows Setup, most likely)

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top