Every now and then, I’ll learn a little tip that makes me think, “Wouldn’t that have saved me hours of time a year ago?” As a child, I vividly recall learning how to use the copy and paste functions on my own. It felt as if the entire Internet had suddenly become twice as simple for me.

If you’re new to Windows 10, environment variables are a little-known feature. They both fit in the same category of time-saving dialogue. When you learn about and start using your environment variables of Windows 10, you will immediately realise how much time and work you can save.

Windows 10 supports a wide array of built-in environment variables. 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 of windows 10
environment variables of Windows 10

­­­­­­­­­­_________________

In this Article

  • Windows 10 – What Actually is Environment Variable?
  • What Is the Importance of Environmental Variables?
  • List of all Windows 10 path environment variables
  • Other Windows 10 Default Environment Variables
  • How to list all Windows environment variables?
  • How to Discover the PATH Variable?
  • How to Set Environment Variables in Windows 10?
  • Why Am I Unable To Change Environment Variables of Windows 10?
  • Where Can I Look for Windows 10 Environment Variables?
  • Windows 10 Environment Variables – Our Final Words

_________________

Understanding Windows 10 Environment Variables

1. What Actually is Environment Variable?

An Environment Variable is actually rather straightforward. They serve as dynamically named values for specific aspects of Windows and its file system.

For example, per cent SystemDrive per cent is a default system path variable that is compatible with all versions of Windows. Like you and me, this most likely translates to C: However, some users determine that renaming their system disc is vital. Someone could opt to assign it the drive letter D or E. In those circumstances, %SystemDrive% would return the corresponding data.

All environment variables of Windows 10 are in the format of %NAME%, that is, the actual variable name is between the % characters. For example, %TEMP% is a commonly used environment variable, always representing a folder for storing temporary files.

2. What Is the Importance of Environmental Variables?

Things change with each new edition of Windows. In Windows XP, for example, your application data was saved in path C: Documents\Settings\{username}\Application\Data. After Vista, it is now C:Users\{username}\App\DataRoaming. So, how do apps know where to save your data? Must they first ascertain what operating system you’re using, disregarding the potential of future modifications and Windows updates, and then hardcode where to save?
No. They make use of the %APPDATA% environment variable, which dynamically retrieves the values of those paths.

Consider environment variables of Windows 10 to be a method of future-proofing your system and preventing it from problems that hardcoded values might cause to be disastrous.

Environment Variables of Windows 10 – Path & Defaults

3. List of all Windows 10 path environment variables

These are all Windows 10 environment variables relating to user or system paths.

VariableDefault location
%ALLUSERSPROFILE%C:\ProgramData
%APPDATA%C:\Users{username}\AppData\Roaming
%COMMONPROGRAMFILES(x86)%C:\Program Files (x86)\Common Files
%COMMONPROGRAMW6432%C:\Program Files\Common Files
%COMSPEC%C:\Windows\System32\cmd.exe
%DRIVERDATA%C:\Windows\System32\Drivers\DriverData
%HOMEDRIVE%C:\
%HOMEPATH%C:\Users\{username}
%LOCALAPPDATA%
C:\Users\{username}\AppData\Local
%LOGONSERVER%\{domain_logon_server}
%ONEDRIVE%C:\Users{username}\OneDrive
%PATH%C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
%PROGRAMDATA%
C:\ProgramData
%PROGRAMFILES%C:\Program Files
%PROGRAMW6432%
C:\Program Files
%PROGRAMFILES(X86)%C:\Program Files (x86)
%PUBLIC%C:\Users\Public
%PSMODULEPATH%%SystemRoot%\system32\WindowsPowerShell\v1.0\Modules\
%SYSTEMROOT%
C:\Windows
%TEMP%C:\Users{username}\AppData\Local\Temp
%TMP%C:\Users{username}\AppData\Local\Temp
%USERPROFILE%
C:\Users\{username}
%WINDIR%C:\Windows

4. Other Windows 10 Default Environment Variables

While the path environment variables are most commonly used and better known in Windows 10, there are also some other types of environment variables in Windows 10 as well. They are listed here.

VariableDefault content
%CD%Outputs current directory path. (Only in Command Prompt.)
%CMDCMDLINE%Outputs command line used to launch current Command Prompt session. (Only in Command Prompt.)
%CMDEXTVERSION%Outputs the number of current command processor extensions. (Only in Command Prompt.)
%COMPUTERNAME%Outputs the computer name.
%DATE%Outputs current date. (Only in Command Prompt.)
%ERRORLEVEL%Outputs the number of defining exit status of previous command. (Only in Command Prompt.)
%PATHEXT%.com;.exe;.bat;.cmd;.vbs;.vbe;.js;.jse;.wsf;.wsh;.msc
%NUMBER_OF_PROCESSORS%Outputs the number of physical and virtual cores.
%OS%Windows_NT
%PROMPT%$P$G
%PROCESSOR_IDENTIFIER%Outputs processor identifier.
%PROCESSOR_LEVEL%Outputs processor level.
%PROCESSOR_REVISION%Outputs processor revision.
%RANDOM%
Outputs random number between 0 and 32767.
%SYSTEMDRIVE%C:
%TIME%Outputs time. (Only in Command Prompt.)
%USERDOMAIN%Userdomain associated with current user.
%USERDOMAIN_ROAMINGPROFILE%Userdomain associated with roaming profile.
%USERNAME%The username of the currently logged in user.

Note: All environment variables of Windows 10 are case insensitive. This means that the system will accept %PATH% as well as %path% and %Path% to represent the Windows Path variable.

Environment Variables in Windows 10 – How To Guide

5. How to list all Windows environment variables?

The above two tables contains all Windows 10 environment variables. However, if you want, you can also use Windows PowerShell to list all the environment variables from your system. Here is how to list all PowerShell environment variables.

Run the following command in Windows PowerShell to list all environment variables:

Get-ChildItem Env: | Sort Name PowerShell

There are many other useful commands within Windows PowerShell relating to the environment variables of Windows.

The operating system and other applications utilise environment variables to store data. The WINDIR environment variable, for example, holds the path to the Windows installation directory. This variable’s value can be used by programmes to determine the location of Windows operating system files. In any of the supported operating system platforms, PowerShell can access and manage environment variables. In the current console, the PowerShell environment provider allows you to obtain, add, update, clear, and remove environment variables.

Microsoft, about Environment Variables

For more information on how to use PowerShell to work with environment variables, please see the documentation of PowerShell on Microsoft’s website.

It’s also possible to list all Windows environment variables using Command Prompt. To list all Windows environment variables, simply type in the command:

SET

6. How to Discover the PATH Variable?

Select or highlight the PATH variable in the System Variables section of the Environment Variables window.

Click the Edit button after highlighting the PATH variable in System Variables.

You can add or change the path lines to point to the locations where your computer should seek for executable files. You’ll notice that each directory is separated by a semicolon, such as:

C:Program Files;C:Winnt;C:WinntSystem32

You may check more environment variables in the System Variables section by clicking Edit.

Similarly, environment variables such as PATH, HOME and USER PROFILE, HOME and APP DATA, TERM, PS1, MAIL, TEMP, and so on exist. These Windows environment variables are quite helpful and may be used both in scripts and on the command line.

In terms of the command line, you can put your modifications to the test by creating a new PowerShell window and typing the following:

$env:PATH

7. How to Set Environment Variables in Windows 10?

It’s also possible for you to set environment variables in Windows 10. To set an environment variable, simply follow these steps:

  1. On the Windows taskbar, right-click the Windows icon and select System.
  2. In the Settings window, under Related Settings, click Advanced system settings
  3. On the Advanced tab, click Environment Variables.
  4. Click New to create a new environment variable.

You can also use the above method to edit Windows environment variables, including how to set the Windows path variable or edit the Windows path variable.

Environment Variables of Windows 10 – FAQ

8. Why Am I Unable To Change Environment Variables of Windows 10?

You may be unable to set these variables for a variety of reasons. The first of your issues might be that you lack administrative privileges. You must be the system Administrator to establish or update this function.

If you are the Admin of your interface but the edit feature is greyed off, try going to the Control Panel from the Start menu and selecting Environment Variables. Then, under ‘Advanced System Settings,’ select ‘Environment Variables.’

9. Where Can I Look for Windows 10 Environment Variables?

To locate environment variables in Windows 10, use the procedures outlined above to locate the information stashed away under the system’s advanced settings.

If you just need to view what the variables are but not modify them, you may open a command-line interface by pressing Ctrl-Esc and typing “cmd” in the command box, followed by “set” in the command window. This command displays all of your system’s environment variables.

10. Can I get Rid of Environment Variables?

You cannot delete the value of an environment variables of windows 10 while maintaining its name from the Environment Variables box using the mouse and keyboard. If you choose a variable and hit Edit, you can erase the value, but you can’t push OK since it’s greyed out.

Windows 10 Environment Variables – Our Final Words

Windows 10 environment variables make it exceedingly simple to take control of your Windows device and optimize its performance.

Using environment variables is a very frequent approach in development, however, it is not a good practice in production. One of the key reasons for this is that employing environment variables might result in unexpected persistence of variable values.

Environment variables are more secure than plaintext files since they are volatile/disposable rather than stored. If you only set a local environment variable, such as “set pwd=whatever,” and then run the script with something that exits your command shell at the end, the variable will be lost.

This article has covered everything you need to know about Windows 10 Environment Variables. Follow the easy procedures outlined in this article to identify and set environment variables of Windows 10. Other than environment variables, there are various kind of other commands that requires your attention so you can cheer on your windows accessibility. For all power shell commands, you can read them here.