There's no such thing as a stupid question, but they're the easiest to answer.


Search Search
Search for:
Tech Support Guy > > >

Solved: What is a valid Windows x86 Program Files variable?


Blacqwolf's Avatar
Blacqwolf   (Benjamin) Blacqwolf is offline
Computer Specs
Member with 56 posts.
Join Date: Sep 2011
Location: Florida
13-Aug-2012, 07:34 PM #1
Solved: What is a valid Windows x86 Program Files variable?
This may or may not be the right section for this - I am posting here because I figure this is where I'd get the best answers

I am currently working on a user-friendly HLDS server installer script. It needs access to the 32-bit Program Files directory so it can access the HLDS Update Tool for downloading/updating the server files, and I want the Program Files (x86) directory to be accessed using a variable, so a single script works on both x86 and x64 systems. However, I'm not sure how to do this.

I use the %programfiles(x86)% variable, and it works fine - on 64-bit systems. If I try it in a Windows XP x86 VM, it fails to find the directory - so either my XP installation or 32-bit Windows operating systems in general don't recognize the variable.

In short; what's the best variable for the x86 Program Files directory that will work on both x86 and x64 OS installations?
dedonmonday's Avatar
dedonmonday   (Adrian) dedonmonday is offline
Computer Specs
Member with 1 posts.
Join Date: Aug 2012
Experience: Intermediate
13-Aug-2012, 10:36 PM #2
Only on 64-Bit systems the folder "Program Files (x86)" is existent, so a simple If statement could be used to check if there is a folder called "Program Files x86".
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

You Are Using: Server ID
Trusted Website Back to the Top ↑