Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For example, I was interested in the differences between %WINDIR% and %SYSTEMROOT%. I've googled abit and through some forum digging, I've found out that %WINDIR% and %SYSTEMROOT% refers to the same thing. %WINDIR% is for 9x and %SYSTEMROOT% is for windows NT and up (but they can also use %WINDIR%).

Of course one would be suspicious about information retrieved from forum vaults, so basically in this example I was trying to confirm if it is really the case that %WINDIR% is for 9x and %SYSTEMROOT% is for windows NT and up. I can't actually test these myself of course (without the respective machines).

I was wondering how do we get authoritative sources for information on environment variables / system variables? (does MSDN has a list?)

share|improve this question
It is notoriously hard to find MS documentation on any particular subject unless you already have a pretty good idea of where to look. I'm not personally aware of any such list, but that doesn't mean it isn't in there ... somewhere. – Harry Johnston Oct 8 '11 at 0:16
In this particular case, whenever possible it is preferable to use the documented GetSystemDirectory() API rather than looking up an environment variable. – Harry Johnston Oct 8 '11 at 0:17
@HarryJohnston: You've never tried Google or the MSDN forums huh? – surfasb Oct 8 '11 at 0:35
@surfasb, in my experience, Google or forum searches don't usually help unless you already know the answer, because that's what determines the successful keywords. YMMV. – Harry Johnston Oct 8 '11 at 0:39
@HarryJohnston I mean i'm not interested in just this one function, but rather the vault where they store information for all these things. There had to be one isn't it, else how did the first person knew about it? – Pacerier Oct 8 '11 at 0:56
up vote 3 down vote accepted

These are System Variables as opposed to Local Environmental Variables which are also used in batch file processing.

How do you find information on them? One answer. MSDN. Dig in and you can find all this and more for Microsoft products. Windows XP Product Documentation - Command shell overview

Also, in the online help for Windows XP and Windows 7 available from the Start Menu, pay attention to Command Line batch processing. These are used heavily in console scripts and the online help has sample code if you look for it. Think of it as "man" on the Linux command line, it's loaded on every Windows system, just like man pages are loaded on Linux.

share|improve this answer
I guess I had to accept this as answer, since we don't have a better one! – Pacerier Oct 8 '11 at 5:32

Consider visiting, it has complete collection of common environment variables for Windows platform with descriptions, default values and differences between Windows XP & Vista/7.

Hope that helps.

share|improve this answer

While Microsoft provides the variables, discreet programs are the users. It's like asking for an authoritative source on the laws of the US. While Congress writes the laws, the Executive branch enforces them, and the Judicial branch interprets them, and it is up to the lawyers to find the tactics that best fits. One source for a model that involves numerous parties is by definition incomplete.

You will have to be more specific unless you want to dig through two decades worth of documentation.

Currently, you can download a code sample that lists all the variables if the technet article isn't clear enough.

As far as what you've posted, that seems pretty clear to me. Are you looking from a programming side or from a troubleshooting side?


Actually, you aren't asking for an authoritative source. You are asking for a historical source. Since Windows 95 isn't officially supported, you are no longer going to find a official Microsoft source.

%Windir% was a variable used by Windows 95, because it was DOS based. Back then, the Windows directory wasn't necessarily located on the C drive. Heck, it was possible it wasn't even a local drive!

%Systemroot% was used by NT. Keep in mind they were two separate product lines.

When the two product lines merged with Windows 2K, they kept both of them since numerous programs used either one. It has been in Windows ever since.

But for all practical purposes, you should use Systemroot, since that is what Microsoft recommends.

I'm sure there is a Old New Thing post that talks more about this. . .


This script will list all the scripting variables and their values on their machine.

Here is an Technet list.

share|improve this answer
Hmm, I've edited the question to reflect on your questions. – Pacerier Oct 7 '11 at 23:57
I'll edit my answer. – surfasb Oct 8 '11 at 0:22
I mean I don't get it, how do you get information for this kind of things? That's what I'm looking for. How did you know all these things and can be sure they're right if there's no document from Microsoft where we can point to like one of the W3C standards document? – Pacerier Oct 8 '11 at 0:55
@Pacerier: A lot of the evidence is anecdotal. Documentation takes a funny definition is the industry. When you put something down as documentation, it is pretty much set in stone. And you are contractually bound to support whatever you wrote. So in some sense, if it is a feature that was a temporary measure in the first place that you plan to replace with a more permanent feature, then you don't document it. In this case, the statements like "windir was a dos variable" doesn't belong in documentation. That is just noise. Programmers don't necessarily want the historical context. – surfasb Oct 8 '11 at 1:26
More often than not, programmers want to know what are the properties, what are the methods, what namespace it belongs to. Everything else is noise. – surfasb Oct 8 '11 at 1:27

Microsoft are the vendors of the operating systems you refer to and so would be the authoritative source of information regarding system environment variables used in their operating systems.

How well they document these things is another matter.

share|improve this answer
yes I know that microsoft is an authoritative source, but where do they document such things that's the question. – Pacerier Oct 7 '11 at 12:20
I'm quite sure they have the documentation locked in a vault somewhere in Redmond. – Daniel R Hicks Oct 7 '11 at 13:07
@DanH Shoudn't MSDN has a list? – Pacerier Oct 7 '11 at 23:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .