Does microsoft release information on environment variables / system variables used in Windows?

Does microsoft release information on environment variables / system variables used in Windows?

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?)

1 Answer

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.

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.

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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *