- C:
- Program Files (x86)
FolderRisk: Caution
- Localized name
Program Files (x86) C:\Program Files (x86)
Program Files (x86): 32-bit applications installed on 64-bit Windows, kept apart from those in Program Files. Absent from 32-bit editions of Windows.
What it’s for
On 64-bit Windows, 32-bit applications install here, apart from the 64-bit ones in C:\Program Files. The split keeps a 32-bit and a 64-bit library of the same name from colliding, as part of the WOW64 compatibility layer.
What it contains
- One subfolder per application or vendor: 32-bit executables, libraries and resources.
- Shared folders such as
Common Filesand, depending on the version, a few 32-bit Windows components. - For a 32-bit application on 64-bit Windows, the
FOLDERID_ProgramFilesX86identifier returns this folder. On 32-bit Windows it returnsProgram Files.
Risks and best practices
- Paths inside this folder are recorded in the registry, in shortcuts and in services, so moving or renaming it breaks all of them. Uninstall an application from Installed apps or with its own uninstaller, not by deleting its folder.
- Keep the default permissions. Write access is limited to administrators and TrustedInstaller, which makes it harder to drop malicious code here.
- In scripts, use
%ProgramFiles(x86)%and%ProgramW6432%instead of a hard-coded path. A 32-bit process that reads%ProgramFiles%gets this folder anyway.
Useful commands
# Variables depending on context (64-bit process)$env:ProgramFiles; ${env:ProgramFiles(x86)}; $env:ProgramW6432
# 32-bit application foldersGet-ChildItem ${env:ProgramFiles(x86)} -Directory | Select-Object Name
# 32-bit applications declared in the registryGet-ItemProperty 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*' | Select-Object DisplayName, DisplayVersion | Sort-Object DisplayName