%ProgramFiles%

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

:info: Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
Post Reply
oblivion
Posts: 156
Joined: 13 Apr 2011 11:35

%ProgramFiles%

Post by oblivion »

I've been trying to diagnose and fix some weird behaviour on a couple of my systems. In my investigations, I discovered that the %ProgramFiles% environment variable was set to \Program Files (x86) instead of what it should be.

So a bit more digging and general paranoia later, I think it's XYplorer misreporting it rather than it actually being wrong.

So my most recent experiment: reboot, open a command prompt, type set and look to see if it's wrong. It isn't.

Start XYPlorer, open a command prompt, type set and look again. Still correct.

Then look at the environment variables list produced from XYPlorer's Help menu. There, it's wrong.

Double-check from a command prompt: still okay.

Now: I thought (but can't currently verify) that I'd checked from a command prompt at some point previously and found it wrong.

So I guess the question is: is XYPlorer reporting something correctly that's otherwise being masked, or is it getting it wrong and under some circumstance (possibly as a result of running something from XYPlorer) actually setting the variable? Or is it just getting it wrong for some reason and causing me to be unnecessarily paranoid? ;)

(Windows 10 and Windows 7, 64-bit (obviously!) and XY 19.30
-- bests, Tim

...This space unintentionally left blank.

admin
Site Admin
Posts: 67271
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: %ProgramFiles%

Post by admin »

If you are looking for a variable that always points to the 64-bit programs folder (usually C:\Program Files) independently of the bitness of the hosting process it's %ProgramW6432%.

oblivion
Posts: 156
Joined: 13 Apr 2011 11:35

Re: %ProgramFiles%

Post by oblivion »

No, I'm not trying to find a variable, I'm trying to work out why something entirely unrelated to XYplorer broke -- but which I might well have installed from an XYplorer window. It might not be an XYplorer issue at all -- but I'm concerned that XYplorer, in reporting the %ProgramFiles% variable incorrectly, might also create an environment with that variable incorrectly set when (for instance) a program is run from an XYplorer window. Might an installer, for instance, read the %ProgramFiles% variable when it assesses the appropriate place to install itself, and might it have been given that information by XYplorer?
-- bests, Tim

...This space unintentionally left blank.

admin
Site Admin
Posts: 67271
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: %ProgramFiles%

Post by admin »

Nothing to do with XYplorer. These variables are resolved by Windows, and some of them take the bitness of their process into account.

Code: Select all

                      32-bit process              64-bit process

%ProgramFiles%        C:\Program Files (x86)      C:\Program Files
%ProgramFiles(x86)%   C:\Program Files (x86)      C:\Program Files (x86)
%ProgramW6432%        C:\Program Files            C:\Program Files

oblivion
Posts: 156
Joined: 13 Apr 2011 11:35

Re: %ProgramFiles%

Post by oblivion »

Ah -- I think I understand. So you're saying that it's not that XYplorer is misreporting %ProgramFiles%, it's providing the answer that Windows gives when a 32-bit process queries the variable?

I'm not used to the concept of an environment variable that's context-sensitive :)

Thanks for the clarification. Sounds like I'm barking up the wrong tree in my attempts to work out what went wrong...
-- bests, Tim

...This space unintentionally left blank.

Post Reply