h3mm3's blog

Stories from behind the keyboard

  • RSS
  • Twitter

Today a friend of mine was looking for the Windows environment variable that defines the x86 version of Program Files folder inside an x64 Windows OS. After a little search, I found that you can simply open a Command Prompt (cmd.exe) and launch the good old DOS command “SET” in order to list all the environment variables. You can even get the list of all the environment variables starting with a letter or a string (for instance “program”), typing something like

C:\> SET program

For instance, these are the environment variables defined in my system and starting with the string “program”:

ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files

Of course you can execute something like

C:\> SET > environment.txt

in order to save all values in a text file called environment.txt.

By the way, a good source of information about SET and other Command Prompt’s goodies is http://SS64.com/nt.

> exit

No comments: