UPDATED 8/1/2023: On Windows 11 (and 10), environment variables are predefined names representing the path to certain locations within the operating system, such as a drive or a particular file or folder.
Environment variables can be helpful in many scenarios, but they’re particularly useful if you’re a network administrator or troubleshooting a device, 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 a path like “C:\Users\UserName\AppData\Roaming,” you can open the “Run” command, type this variable “%APPDATA%,” and press Enter to access the same path. Or you can use the “%HOMEPATH%” variable to access the current user’s default profile folder location (where the system stores the folders for Desktop, Documents, Downloads, and OneDrive).
This guide will teach you the list of the most common environment variables you can use on Windows 11 (and on Windows 10 ).
Windows 11 (and 10) default environment variables
| Variable | Windows 10 and Windows 11 |
|---|---|
| %ALLUSERSPROFILE% | C:\ProgramData |
| %APPDATA% | C:\Users{username}\AppData\Roaming |
| %COMMONPROGRAMFILES% | C:\Program Files\Common Files |
| %COMMONPROGRAMFILES(x86)% | C:\Program Files (x86)\Common Files |
| %CommonProgramW6432% | C:\Program Files\Common Files |
| %COMSPEC% | C:\Windows\System32\cmd.exe |
| %HOMEDRIVE% | C:\ |
| %HOMEPATH% | C:\Users{username} |
| %LOCALAPPDATA% | C:\Users{username}\AppData\Local |
| %LOGONSERVER% | \{domain_logon_server} |
| %PATH% | C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem |
| %PathExt% | .com;.exe;.bat;.cmd;.vbs;.vbe;.js;.jse;.wsf;.wsh;.msc |
| %PROGRAMDATA% | C:\ProgramData |
| %PROGRAMFILES% | C:\Program Files |
| %ProgramW6432% | C:\Program Files |
| %PROGRAMFILES(X86)% | C:\Program Files (x86) |
| %PROMPT% | $P$G |
| %SystemDrive% | C: |
| %SystemRoot% | C:\Windows |
| %TEMP% | C:\Users{username}\AppData\Local\Temp |
| %TMP% | C:\Users{username}\AppData\Local\Temp |
| %USERDOMAIN% | Userdomain associated with current user. |
| %USERDOMAIN_ROAMINGPROFILE% | Userdomain associated with roaming profile. |
| %USERNAME% | {username} |
| %USERPROFILE% | C:\Users{username} |
| %WINDIR% | C:\Windows |
| %PUBLIC% | C:\Users\Public |
| %PSModulePath% | %SystemRoot%\system32\WindowsPowerShell\v1.0\Modules\ |
| %OneDrive% | C:\Users{username}\OneDrive |
| %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. |
| %OS% | Windows_NT |
Although you can use environment variables to access certain locations within Windows 11 quickly, you’ll typically use these variables when building a script or an application.
Keep in mind that some of the variables mentioned are not location-specific, including %COMPUTERNAME% , %PATHEXT% , %PROMPT% , %USERDOMAIN% , %USERNAME% .
You can always view all the environment variables available on your device using the Get-ChildItem Env: | Sort Name PowerShell command.
While this guide is focused on Windows 10 and 11, it’s important to note that these variables will also work on Windows 8.1, Windows 7, and Windows Vista.
UPDATE 8/1/2023: On Windows 10, Snip & Sketch is the default app for taking screenshots of the entire screen, active window, or region of the screen. Usually, you can open the screen snipping tool from the Start menu or with the “Windows key + Shift + S” keyboard shortcut, but if you want more direct access, it’s also possible to map the app to the “Print Screen” (PrtScrn) key on the keyboard.
This guide will teach you the steps to set the Print Screen key on your keyboard to open the screen snipping tool on Windows 10 .
Take screenshots using the ‘Print Screen’ key on Windows 10
To open the Snip & Sketch app to take screenshots with the “PrtScrn” key on Windows 10, use these steps:
- Open Settings on Windows 10.
- Click on Ease of Access .
- Click on Keyboard .
- Under the “Print Screen shortcut” section, turn on the “Use the PrtScn button to open screen snipping” toggle switch.
Once you complete the steps, if you have another application currently mapped to use the Print Screen button, you may need to restart the computer to apply the settings.
After applying the changes, you can press the “PrtScrn” key on the keyboard to bring up the tool to take a snip or full-screen capture of anything that you’re running on the desktop.