I want to write something like
%ProgramFiles(x86)%\someprogram\someprogram.exe
That would work in both Windows 32 and 64-bit versions
But:
%ProgramFiles%
points to the 32 bit program files folder only in 32bit Windows%ProgramFiles(x86)%
points to the 32 bit program files folder only in 64bit Windows (it doesn't exist in 32-bit Windows)
Is there any Windows Environment variable that always point to the 32 bit program files folder, regardless of the Windows version?
Best Answer
You can always add
%ProgramFiles(x86)%
to the 32bit Windows platforms. You can use a simple command line to add it:Set ProgramFiles(x86) = "C:\Program Files"
Then you have consistency across platforms.
Edit:
Since you told me what it is for, I would do something like this for your instructions: