How to Edit Environment Variables on Windows 10 or 11
This article will discuss how to edit environment variables on Windows 10 or 11. Editing your PC’s environment variables can save you time in Command Prompt and make your scripts more concise. It also allows you to customize where Windows stores certain files. So, let’s find out how to edit them.
Understanding How Environment Variables Work
Environment variables are crucial in pointing to important directories or settings on your PC. For example, they can indicate the location of the Windows Temp folder or provide information about your PC, such as the version of Windows it is running or the number of processor cores it has available. These variables can be accessed by any program or script running on your computer. Additionally, environment variables can be defined for individual user accounts or system-wide.
The Significance of the Path Variable
Among various environment variables, the Path variable holds particular importance. It determines which folders are checked for executables when a command is run in a terminal or a script. To illustrate, let’s consider Notepad and Chrome. If you type “Notepad” into Command Prompt, it will launch immediately. However, if you type “Chrome,” you’ll encounter an error message. This error is because the Notepad executable is located in a folder specified in the Path variable, while the Chrome executable is not.
By default, the Path variable only points to a few Windows folders. However, you can easily add more folders to it.
Before proceeding, it is crucial to note that changing environment variables can lead to your PC malfunctioning. Therefore, it is essential to double-check your actions if you plan to add, edit, or delete an environment variable.
How to Edit Environment Variables
Though there may be some minor differences in the user interfaces between Windows 10 and Windows 11, the process of editing environment variables remains largely the same.
To configure your environment variables, follow these steps:
- Click the Start button on your Windows desktop.
- Type “environment properties” into the search bar.
- Hit Enter to proceed.
- In the System Properties window, locate and click “Environment Variables.”
Once you are in the Environment Variables window, you can start editing them.
To change an environment variable:
- Select the variable you want to change.
- Click “Edit.”
- Simply modify the value as desired.
- Click “OK” to save the changes.
If you wish to add an environment variable, follow these steps:
- Click “New.”
- Specify the variable name and value.
- Note that the variable value can encompass multiple values, separated by semicolons.
- Once you’ve named your variable and assigned a value, click “OK” to save the changes.
Some environment variables, like the Path variable, have a slightly different appearance but function similarly. The Path variable is essentially a list; you can add, edit, or delete entries.
To add another folder to the Path variable, follow these steps:
- Click “New” in the Path section.
- Specify the folder you want to add.
- Click “OK” to save the changes.
Customizing your environment variables is highly recommended if you frequently use batch or PowerShell scripts or rely on non-Windows command-line applications. Despite the initial effort, you will save significant time in the long run. However, always remember the warning mentioned earlier about the potential for the PC to malfunction when editing environment variables.