On Windows 10, environment variables are globally known names that refer to certain path locations within the operating system, such as to a particular folder or drive on your computer.
For example, instead of having to browse to C:\Users\accountName to access your account folders, you can simply type %HOMEPATH% in the Run command and hit enter to access the same location.
There are a number of built-in environment variables on Windows 10 that can come in handy on a number scenarios, especially when creating a script. However, you’re not limited to the default list, you can create your very own variables if you want to have quicker access to certain locations.
In this guide, you’ll learn the steps to create custom environment variables on Windows 10.
How to create custom environment variables
- Open Start.
- Search for Edit the system environment variables and click the result.
- On the Advanced tab, click the Environment Variables button.
- System Properties
- Under User variables, click New.
- Custom Environment Variables
- On the Variable name field, enter the name you want for the variable (e.g. PIX).
- On the Variable values field, enter the path for the folder, drive, or file you want to open with the new variable (e.g. C:\Users\Admin\Pictures).
- Click OK.
- New user variable
- Repeat the steps 4, 5, 6, 7 to add more custom variables.
- Click OK to complete the task.
Once you complete the steps, you can test new environment variable by opening the Run command (Windows key + R), typing the name of variable (e.g. %PIX%), and clicking OK.
Open Start.
Search for Edit the system environment variables and click the result.
On the Advanced tab, click the Environment Variables button.
System Properties
Under User variables, click New.
Custom Environment Variables
On the Variable name field, enter the name you want for the variable (e.g. PIX).
On the Variable values field, enter the path for the folder, drive, or file you want to open with the new variable (e.g. C:\Users\Admin\Pictures).
Click OK.
New user variable
Repeat the steps 4, 5, 6, 7 to add more custom variables.
Click OK to complete the task.
If you want to delete a variable, you can follow the same steps, but on step 4, select the variable, and click the Delete button.