WiseCleaner Think Tank

Encounter difficult computer problems?
All about maintenance and optimization of your Windows System.

Home > Think Tank > How to Create Environment Variables on Windows 11

How to Create Environment Variables on Windows 11

Nov 9, 2023

Environment variables refer to the location of certain paths in a computer's operating system. Use environment variables to store information about your system, such as its processes and resource usage. Setting an environment variable creates a shortcut to a path that allows you to use keywords to find data locations without typing the entire location path. This article will tell you how to create an environment variable and how to use it.
 

How to create environment variables

Creating environment variables is very simple, you only need to follow the following steps to complete.
 

Method1. Create Environment Variables using System Properties

Step1. Open the System Properties

Click on Windows Start and type ‘Edit the System Environment Variables’ in the search box. Find and open the matched item.


Step2. Create environment variables

Once you open the System Properties, click on the Advanced tab, and select the Environment Variables button.


Under the “User variables for admin” section, click the New button.


Next, name your newly created variable, please be careful not to set any spaces. In the Variable Value section, you can copy and paste the path from the folder, or you can click the "Browse Directory" or the "Browse File" button to determine the target location.


After you have finished typing, click the OK button. The environment variable you created will then take effect.
 
If you want to delete a created variable, just go to the "User variables for admin" section, select the variable, and click delete.
 

Method2. Create Environment Variables using PowerToys

You can also set environment variables through PowerToys. The specific steps are as follows.
 

Step1. Download and install PowerToys

If PowerToys is not installed on your computer, you can search for it in the Microsoft Store to download and install it.
 

Step2. Create environment variables

Open the PowerToys and click on Environment Variables in the left pane. Then turn on the “Enable Environment Variables” toggle switch, and click the “Launch Environment Variables” option.

When the User Account Control window pops up, select Yes.
 
Under the “User” section, click on the Add variable button.


Name the variable you want to create, for example, picture. Then open File Explorer and copy the path to this folder and paste it under Value. Finally, click Save.

Using the New Environment Variable via Run

Once set up successfully, you just need to click Win + R to open the Run, then enter %variablename% in the text box, and click OK to access the specific location directly.

Notice: Please replace the variablename with the variable name you created.


Creating an environment variable can help you access certain locations faster and be more productive, which is very convenient. If you often need to access a fixed location, then creating a variable can be more efficient and convenient. If you have other difficulties with computer use, welcome to visit WiseCleaner.













50