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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to read values of environment variables 2

Status
Not open for further replies.

mingis

Programmer
Jan 23, 2002
475
0
0
LT
like TEMP, PATH etc.?
Of course, I can execute system("set > logfile.log") but it is not so elegant for end user aplication. Under Win2000 I found registry key HKEY_CURRENT_USER\Environment\TEMP, but its value encloses a reference to another env. variable USERPROFILE, which I cannot find. What about Win98?
 
wouldn't [tt]getenv()[/tt] work?
tellis.gif

[sup]programmer (prog'ram'er), n A hot-headed, anorak wearing, pimple-faced computer geek.[/sup]​
 
If you want the temp path, you can just call GetTempPath API.
Greetings,
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top