How to add an environment variable in Windows 10

Windows 10 allows you to change or add custom environment variables. Here are the steps to add an environment variable in Windows 10.

What is an environment variable?

Windows has a number of different built-in environment variables for opening folders, folders, and running processes. Some built-in variables include TEMP, userprofile, windir, prefetch , .

How do environment variables in Windows work?

In fact, Windows even creates some custom environment variables for its own applications. For example, to open the OneDrive folder, you can simply execute the "OneDrive" command in the Run window. This happened because OneDrive created a new environment variable in the background.

If you have a directory or process that you want to open with a dynamic value, you can add an environment variable for that value. For example, you have a custom variable to open the Downloads folder . This makes it easy to access the folder in custom scripts and other applications. You don't have to worry about the actual directory location as long as it is properly configured in the environment variable.

Here are the steps to add an environment variable in Windows 10.

Steps to add an environment variable in Windows 10

To add a new environment variable, follow the steps listed below.

Step 1. Open the Start menu by pressing the Windows key .

Step 2. Type Environment variables and click on the result Edit the system environment variables .

Step 3. Click the Environment variables button in the Advanced tab .

Step 4. You can create a User Variable or a System Variable (system variable).

  1. User variable : Only available to that specific user.
  2. System variable : Available to all users including system programs.

Picture 1 of How to add an environment variable in Windows 10
You can create User Variable or System Variable (system variable).

Step 5. To create a user variable, click New in the User Variables section .

Step 6. To create a system variable, click New in the System Variables section .

Step 7. Now enter the variable name in the first field. Make sure the name has no spaces or special characters.

Step 8. Next, enter the variable value in the second field. For example, to open a folder, you must enter its path in the Value field .

Picture 2 of How to add an environment variable in Windows 10

Step 9. Click OK to add the environment variable.

Step 10. Click OK in the environment variables window.

Picture 3 of How to add an environment variable in Windows 10

Step 11. In the main window, click Apply> OK button .

Step 12. Restart Windows 10 to apply the new environment variable.

From now on, you can use the custom variable from the Command Prompt window or the Run window . To use an environment variable add "%" to the beginning and end of the variable name. For example, if you want to open your Downloads folder, issue the command "% download%". If you don't add the "%" sign, Windows won't recognize the variable value.

Picture 4 of How to add an environment variable in Windows 10

Good luck.
Update 07 September 2020
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile