Automagical folders

Although the layout of the Windows folders tree is fairly consistent between Windows versions, there are occasional differences.

Example 1

For example, the Windows folder might be called:

Example 2

As another example, the Program Files\Common Files folder is usually called:

Automagical folder icons and behavior

On the Files and folders page, some folders are indicated with the starry folder icon Magical folder icon or Magical folder with UAC shield. They are "automagical" because they adapt automatically to the situation on the target system.

For example, the All Users (XP) automagical folder maps to:

Important automagical folders

The most important automagical folders in the folder tree are shown in the following table. See Standard folders for a complete list and Typical folder paths for different versions of Windows for examples of the corresponding target paths.

Automagical folder Purpose Variable
Target System Root folder on the target system. At installation time, it is set to the Windows Volume volume, i.e., the disk volume (or network share) on which the active version of Windows resides. TARGETDIR
Desktop (Public) The common (or All Users, or Public) Desktop folder. This is where any desktop shortcuts should go. The folder contains subfolders Start Menu and below for shortcuts that should be placed on the Start menu or its Programs menu. CommonDesktopFolder
Program Files (32-bit)
Program Files (64-bit)
Program Files (native)

Root folders for 32-bit, 64-bit, and native (for example, MSIL) application programs and their support files, respectively. Your product should be installed in a product-specific subfolder.

If your product shares files with your other products, they should go into the Common Files subfolder; if it uses files shared with other parties (including system files), they normally go into the Windows\System (32-bit), System (64-bit) or System (native) folders elsewhere in the tree.

Note: Any files stored under one of the Program Files folders and their subfolders should be considered to be read-only. Do not store application data or user documents that must be written or updated in this part of the folders tree.

Instead, use a subfolder under the per-user AppData folders in the Users\Current User subtree for any application data that may be modified and rewrite your application to access the data there, and store user documents by default into Users\Current User\My Documents.

ProgramFilesFolder
ProgramFiles64Folder
ProgramFilesXFolder
ProgramData

Root folder for shared per-application data, i.e., application data that must be maintained for the system as a whole rather than a particular user.

If your product stores system-wide application data, for example presets, templates, etc., it should do so in a product-specific subfolder of ProgramData, such as ProgramData\<Publisher>\<ProductName>

Note: Data stored here should be considered read-only, because the ProgramData folder's permissions do not allow writing by non-elevated processes.

CommonAppDataFolder
Temp Temporary files folder, used to store scratch files during installation and removal. If you store any files here, you should not rely on them to still be present after the next system restart; on many Windows systems, utilities clean up the Temp folder each time the system starts. TempFolder
Windows

Root folder for the Windows user files. It contains a number of subfolders for the Windows system and program files; on any actual Windows system, these subfolders may or may not be physical subfolders of the Windows folder.

For example, some Windows configurations store the system files (System32 subfolder) on a shared network volume, even though the Windows folder itself is always located on a local disk.

WindowsFolder
System (16-bit) Folder for 16-bit system DLLs; only used on Windows 95, 98, Me System16Folder
System (32-bit) Folder for 32-bit system DLLs and programs, and parent for subfolders such as device drivers. SystemFolder
System (64-bit) Folder for 64-bit system DLLs and programs, and parent for subfolders such as device drivers. Only used on 64-bit Windows systems. System64Folder
System (native) Folder for native system DLLs and programs, and parent for subfolders such as device drivers. This folder is equivalent to System (32-bit) when installing on a 32-bit system, and equivalent to System (64-bit) when installing on a 64-bit system. SystemXFolder

Related topics

File, Folder, Shortcut, Installing Files, Installing Shortcuts, Working with project pages