How 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).
- User variable : Only available to that specific user.
- System variable : Available to all users including system programs.
How to add an environment variable in Windows 10 Picture 1 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 .
How to add an environment variable in Windows 10 Picture 2
Step 9. Click OK to add the environment variable.
Step 10. Click OK in the environment variables window.
How to add an environment variable in Windows 10 Picture 3
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.
How to add an environment variable in Windows 10 Picture 4
You should read it
- How to set and list environment variables in Linux
- Variables are predefined in PHP
- Instructions for installing Unix / Linux
- Learn about custom variables in Google Analytics
- REPL Terminal in Node.js
- Global variables (global), local variables (local), nonlocal variables in Python
- Declare variables in SQL Server
- Global keywords in Python
- Endlocal command in Windows
- Variable scope in C ++
- Setx command in Windows
- Variable in JavaScript
May be interested
How to enable microphone in Windows 10
How to remove a CD drive that no longer exists in Windows 10
How to enable / disable clipboard sharing with Windows Sandbox on Windows 10
How to update drivers windows 10
How to open Folder Options or File Explorer Options in Windows 10
How to enable / disable the Archive Apps feature in Windows 10