Written by Kevin Heaton, Insight Software Solutions
This sample macro, available for both Macro Express and Macro Express Pro, demonstrates how to get the Program Files folder that is used for 32 bit applications.
Many of my macros launch programs. For those with computers set to use the English language, programs have traditionally been installed in the ‘Program Files’ folder of the C: drive. With 64 bit Windows, however, 32 bit programs are, by default, installed under the ‘\Program files (x86)’ folder. Only 64 bit programs are installed under ‘c:\Program Files’.
I could simply edit my macros to replace ‘C:\Program Files’ with ‘C:\Program Files (x86)’ but my macros are used on several computers, some of which run the 32 bit version of Windows. Rather than have separate macros for each computer, I have changed my macros to get the correct Program Files folder from Windows itself.
Download either the Macro Express 3 or Macro Express Pro version of the macro file and save it to your hard drive. Open the macro file import the macros into your existing macro file by clicking File, Import, Import Macros.
Program Files Folder – for Macro Express 3 | umprogramfilesfolder3.mex | ||
Program Files Folder – for Macro Express 5 and Macro Express Pro | umprogramfilesfolder.mex |
There is no macro activation assigned to this macro. To run it, highlight it in the Macro Explorer window and click the run button. Use this example macro to modify your own macros to determine where 32 bit applications have been installed on your computer.
Windows sets environment variables that contain the path to the Program Files folder on your computer. For 64 bit versions of Windows, more than one environment variable is defined. This macro reads the environment variables to get the path to the folder where 32 bit applications are installed.
As written, this macro returns the Program Files folder for 32 bit applications. You will need to modify this macro to get the Program Files folder for 64 bit applications.
Written for the English versions of Windows.
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |