Path Shortcuts

Complete list of environment variables on Windows 10

Use these environment variables to quickly browse Windows 10 locations on any computer.

Windows 10 environment variables

On Windows 10, environment variables are predefined names that represent the path to certain locations within the operating system, such as to a drive or a particular file or folder.

Environment variables can be helpful in a number of scenarios, but they’re particularly useful if you’re an IT person or you’re fixing someone else’s computer, as you can quickly navigate to certain locations without even knowing the username or full path to a system folder.

For example, instead of browsing C:\Users\<UserName>\AppData\Roaming, you can open the Run command (Windows key + R), type %APPDATA%, and press Enter to access the same path. Or you can use the %HOMEPATH% variable to access the current user default folders location — where the operating system stores the folders for Desktop, Documents, Downloads, OneDrive, etc.

In this guide, you’ll learn the list of the most common environment variables you can use on Windows 10.

Windows 10 default environment variables

VariableWindows 10
%COMMONPROGRAMFILES%C:\Program Files\Common Files
%COMMONPROGRAMFILES(x86)%C:\Program Files (x86)\Common Files
%CommonProgramW6432%C:\Program Files\Common Files
%PROGRAMFILES%C:\Program Files
%ProgramW6432%C:\Program Files
%PROGRAMFILES(X86)%C:\Program Files (x86)
%USERDOMAIN%Userdomain associated with current user.
%USERDOMAIN_ROAMINGPROFILE%Userdomain associated with roaming profile.
%DriverData% C:\Windows\System32\Drivers\DriverData
%CD%Outputs current directory path. (Command Prompt.)
%CMDCMDLINE%Outputs command line used to launch current Command Prompt session. (Command Prompt.)
%CMDEXTVERSION%Outputs the number of current command processor extensions. (Command Prompt.)
%COMPUTERNAME%Outputs the system name.
%DATE% Outputs current date. (Command Prompt.)
%TIME% Outputs time. (Command Prompt.)
%ERRORLEVEL%Outputs the number of defining exit status of previous command. (Command Prompt.)
%PROCESSOR_IDENTIFIER%Outputs processor identifier.
%PROCESSOR_LEVEL% Outputs processor level.
%PROCESSOR_REVISION%Outputs processor revision.
%NUMBER_OF_PROCESSORS%Outputs the number of physical and virtual cores.
%RANDOM%Outputs random number from 0 through 32767.

Although you can use environment variables to quickly access certain locations within Windows 10, you’ll typically use these variable when building an script or an application.

Keep in mind that some of the variables mentioned are not location specific, including %COMPUTERNAME%, %PATHEXT%, %PROMPT%, %USERDOMAIN%, %USERNAME%.

While this guide is focused on Windows 10, it’s important to note that these variable will also work on Windows 8.x, Windows 7, and Windows Vista.

You can always view all the environment variables available on your device using the Get-ChildItem Env: | Sort Name PowerShell command.

Update June 22, 2020: This guide was originally published in January 2017, and it’s been revised in June 2020.