Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7011161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:05:31+00:00 2026-05-27T22:05:31+00:00

How do I determine the full path of the folder that contains 32-bit programs

  • 0

How do I determine the full path of the folder that contains 32-bit programs using VBA? It’s called “Program Files” on 32-bit Windows systems, but on 64-bit systems it’s called “Program Files (x86)”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:05:31+00:00Added an answer on May 27, 2026 at 10:05 pm

    Environ will do the trick:

    debug.print Environ("ProgramFiles") 
    debug.print Environ("PROGRAMFILES(X86)")
    
    'If you want to check if current PC is x64
    debug.print Environ("PROCESSOR_IDENTIFIER")
    

    List of environment variables can be found here.


    UPDATE: Based on the conversation I’ve had with Christian and based on my comments, I looked into this a little more.

    I have two machines I tested on:

    • Machine 1: Win 7 Ultimate, 64 Bit, Office 2010 64 Bit
    • Machine 2: Win 7 Ultimate, 32 Bit, Office 2007 32 Bit

    I ran the following statements in the immediate window:

    ? Environ("ProgramFiles") 
    ? Environ("PROGRAMFILES(X86)")
    ? Environ("ProgramW6432")
    

    Results

    Machine 1:

    C:\Program Files 
    C:\Program Files (x86) 
    C:\Program Files
    

    Machine 2:

    C:\Program Files
    //Blank//
    //Blank//
    

    So, based on these limited findings, you may want to see the if ProgramW6432 has a value. If not, assume 32 bit and use ProgramFiles.

    IF Environ("ProgramW6432") <> "" THEN
       'I'm 64 bit so check both ProgramW6432 and PROGRAMFILES(X86)
    ELSE
       'I'm 32 bit so check ProgramFiles
    END IF
    

    Conversely, you could use PROCESSOR_IDENTIFIER to determine x64 vs. x86 and do the same thing.

    I wouldn’t say either way is foolproof but should get you on the right track.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I determine the (local-) path for the Program Files directory on a
I have Perl script and need to determine the full path and filename of
I have an IEnumerable full of objects that we are using to represent user
I want to determine the full path of certain folders. In my array, I
Is there a way to query a full text index to help determine additional
How do I determine the size of my array in C? That is, the
How can I determine all of the assemblies that my .NET desktop application has
I'm trying to determine the best starting structure (navigation, windows based, something else) for
With a function being passed a full path to a file, such as C:\someFolder\anotherFolder\someXML.xml
I am writing a program in c++ that accepts a filename as an argument

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.