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
- How to enable microphone in Windows 10after installing windows 10, the microphone may be disabled. if this happens, there are several ways you can fix the problem before you go out and buy a new sound card.
- How to remove a CD drive that no longer exists in Windows 10in this article, tipsmake tech easier readers discover ways to delete a cd that no longer exists in windows 10. let's find out right now!
- How to enable / disable clipboard sharing with Windows Sandbox on Windows 10starting with windows 10 build 20161, a new group policy setting has been added to enable or disable sharing of clipboard with sandbox. if you enable or do not configure this policy setting, then copying and pasting between the host and the windows sandbox will be allowed.
- How to update drivers windows 10have you just installed windows 10 and your computer is missing drivers? or have you installed an automatic driver for your computer, but your computer lacks a driver? please rest assured because you can use the windows update driver to update the windows 10 driver automatically.
- How to open Folder Options or File Explorer Options in Windows 10you can use file explorer options (aka folder options) to change how files and folders work, and how items are displayed on your computer. this tutorial will show you different ways on how to open folder options or file explorer options in windows 10.
- How to enable / disable the Archive Apps feature in Windows 10starting with windows 10 build 20201, a new archive apps feature has been added. this guide will show you how to enable or disable the archive apps feature for your account or specific accounts in windows 10.