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.
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 .
Step 9. Click OK to add the environment variable.
Step 10. Click OK in the environment variables window.
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.
You should read it
May be interested
- Web programming in C ++common gateway interface or cgi is a set of standards that define how information is exchanged between a web server and a custom script.
- What is the staging environment?the staging environment is an exact replica of the production environment for software testing. the staging environment was created for code testing, builds and updates.
- Enable / disable Windows Recovery Environment (WinRE) in Windows 10the windows recovery environment can be used to diagnose and repair a system that windows cannot boot. in this guide, tipsmake.com will show you an easy way to enable or disable winre in windows 10.
- Here's How Windows 11 Protects You From Dangerous .EXE Filessince the version of windows 10, microsoft has introduced to users the windows sandbox feature. this is considered a new lightweight virtual desktop environment, designed to let unknown applications and software run separately and securely from the real external operating system environment.
- Data type in C programmingin the c programming language, data types refer to the system extension used for variable declarations of different types. the type of variable determines the amount of memory used to store that variable and how the bits are stored when released
- Variable in JavaScriptone of the most distinctive features of a program language is the set of data types it supports. this is the type of value that can be represented and manipulated in the program language.
- Scope rules in programming Ca scope in any program is an area in the program where a defined variable exists and outside of that range the variable cannot be accessed.
- How to configure Windows Sandbox on Windows 10the new sandbox feature of windows 10 lets you safely test programs and files downloaded from the internet by running them in a safe environment.
- How to protect your mental and physical health when in a toxic environmentdealing with toxic situations can be incredibly difficult. here are some tips to help you handle toxic environments tactfully and maintain peace of mind.
- How to set environment variables in ZSHin zsh, you can easily set environment variables, either temporarily or permanently, depending on your needs.