How to get value of an environment variable

28 01 2012

Windows Environment Variables hold some system paths or user defined paths. How can we read the contents of a specified environment variable.

There is an API GetEnvironmentVariable, which retrieves the contents of the specified variable from the environment block of the calling process.



void ReadEnvironmentVariable()
	GetEnvironmentVariable( _T("TMP"), tcPath, MAX_PATH );

This function can retrieve either a system environment variable or a user environment variable.




6 responses

16 05 2013
cold call list

This is really interesting, You are a very
skilled blogger. I have joined your rss feed and look forward to seeking more of your great post.
Also, I have shared your web site in my social networks!

16 05 2013
Sanoop S P

Thank you very much.

4 06 2013

I am really pleased to read this webpage posts which carries tons of valuable facts, thanks for providing these

7 06 2013
Sanoop S P

Thank you Sarah

4 07 2013
binäre optionen handeln

Excellent Home Cinema For a Budget? Yes You are able to!

25 05 2017
Herb H

Thanks, this helped me out a lot.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: