Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get program files x86 env variable?

I would like to know how I can display the location of Program Files (x86) in Command Prompt. I'm using Windows 7 64bit.

I've tried:

echo %programfiles(x86)% and echo %programfiles%.

Both of these output C:\Program Files

When I manually checked the registry,
HKLM/Software/microsoft/windows/currentversion,
the programfilesdir points to C:\Program Files and

HKLM/Software/WOW64/Microsoft/windows/currentversion,
the programfilesdir points to C:\Program Files (x86).

But, why am I always seeing C:\Program Files displayed?

like image 372
Ashok Avatar asked Mar 07 '12 00:03

Ashok


People also ask

How do I get to Program Files x86 in command prompt?

While in the command prompt type "cd\", then enter. From there type "cd\program" then hit the tab button until you see "c:\program files (x86)", then hit enter.


1 Answers

On a 64-bit machine running in 64-bit mode:

  • echo %programfiles% ==> C:\Program Files
  • echo %programfiles(x86)% ==> C:\Program Files (x86)

On a 64-bit machine running in 32-bit (WOW64) mode:

  • echo %programfiles% ==> C:\Program Files (x86)
  • echo %programfiles(x86)% ==> C:\Program Files (x86)

On a 32-bit machine running in 32-bit mode:

  • echo %programfiles% ==> C:\Program Files
  • echo %programfiles(x86)% ==> %programfiles(x86)%
like image 191
SecurityMatt Avatar answered Sep 28 '22 22:09

SecurityMatt