1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

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

Discussion in 'Software Development' started by Blacqwolf, Aug 13, 2012.

Thread Status:
Not open for further replies.
  1. Blacqwolf

    Blacqwolf Thread Starter

    Sep 9, 2011
    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?
  2. dedonmonday


    Aug 13, 2012
    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
As Seen On...

Welcome to Tech Support Guy!

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.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1064985