What is the difference between a Registry Key & an Environment Variable?
I think Environment Variables are only something found in windows OS? And I hear thats its very easy to change these so its not good to trust them? Are Registry Keys just as easy to change?
Are Registry keys stored in the kernal?
My most important question is: I know that the environment variables let me know the path to %APPDATA, the current users name, the path to program files, the version of Windows OS running, etc. BUT do the Registry keys also contain this kind of data – can I also find out this information by looking at the registry keys?
Another important difference:
Environment variables are loaded to the process when it starts. So if you change them after the process is running, the process won’t see that.
And about your other question:
User Variables: HKEY_CURRENT_USER\Environment
System Variables: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
An article about the default system variables:
http://vlaurie.com/computers2/Articles/environment.htm