Environment variables for special folders

To ensure that you don’t have to use hard paths in BAT script, MSI, PowerShell and VBScript, you can use environment variables.

Below I have made an overview of the most common environment variables:

DescriptionLocationEnvironment Variable
UserProfileC:\Users\USERNAME%UserProfile%
Temp%UserProfile%\AppData\Local\Temp%TEMP% en %TMP%
Windows DirectoryC:\Windows%SystemRoot%, ook %windir% in batch bestanden
All Users ProfileC:\Users\Public%Public%
Program FilesC:\Program Files
C:\Program Files (x86)
%ProgramFiles%
%ProgramFiles(x86)%
Common AppDataC:\ProgramData%ProgramData% en %AllUsersProfile%
Local AppData%UserProfile%\AppData\Local%LocalAppData%
Program Files CommonC:\Program Files\Common Files
C:\Program Files (x86)\Common Files
%commonprogramfiles%
%commonprogramfiles(x86)%
Application Data%UserProfile%\AppData\Roaming%AppData%
System DirectoryC:\Windows\System32
FontsC:\Windows\Fonts
(My) Documents%UserProfile%\Documents
(My) Pictures%UserProfile%\Pictures
Desktop%UserProfile%\Desktop
Start Menu Programs%UserProfile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
(IE) Favorites%UserProfile%\Favorites
Common Start Menu ProgramsC:\ProgramData\Microsoft\Windows\Start Menu\Programs
Common DesktopC:\Users\Public\Desktop
Shared DocumentsC:\Users\Public\Documents
Shared PicturesC:\Users\Public\Pictures

Leave a Reply

Your email address will not be published. Required fields are marked *