How to create Environment Variables on Windows 11, 10

Custom variables are handy shortcuts for quicker access to folders locations on Windows 11 (and 10) — Here's how you can create them.

Windows 11 Environment Variables
Windows 11 Environment Variables
  • To create Environment Variables on Windows 11 (and 10), open System Properties > Advanced > Environment Variables, and under “User variables for,” click “New,” configure the new variable, and click “OK.”
  • To create variables from PowerToys, open the “Environment Variables” editor, under “User,” click “Add variable,” configure the new variable, and click “Save.”

UPDATED 10/31/2023: On Windows 11 (and 10), you can create Environment Variables in two ways from the System Properties and PowerToys, and in this guide, I’ll outline the steps to complete this configuration using both tools.

“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 11 and 10 that can come in handy in a number of 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, I will teach you the steps to create custom Environment Variables on Windows 10 and 11. 

Create Environment Variables on Windows 11 from System Properties

To create an environment variable on Windows 11 (or 10), use these steps:

  1. Open Start on Windows 11.

  2. Search for Edit the System Environment Variables and click the top result to open the “System Properties” page.

  3. Click the Advanced tab.

  4. Click the Environment Variables button.

    System Properties

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

    New user variable

  6. Confirm the name for the variable in the “Variable name” setting. For example, “PIX.”

  7. Confirm the path for the folder, drive, or file to open with the new variable in the “Variable values” setting. For example, “C:\Users\Admin\Pictures.”

  8. Click the OK button.

    Windows 11 new variable

  9. Click the OK button.

Once you complete the steps, the system will create a new variable, and you can use it to access the specific location or file with the variable. For example, you can open the “Run” command, type the variable (%PIX%), and click the “OK” button.

If you want to delete a variable, you can follow the same steps, but in step 4, select the variable and click the “Delete” button.

Create Environment Variables on Windows 11 from PowerToys

To create new environment variables easily from PowerToys on Windows 11 (or 10), use these steps:

  1. Open PowerToys.

  2. Click on Environment Variables.

  3. Turn on the “Enable Environment Variables” toggle switch (if applicable).

  4. Under the “Activation” section, click the “Launch Environment Variables” option.

    PowerToys Environment Variables tool

  5. Under the “Default variables” section, click the “User” setting to view the current variables.

    Quick note: If you want to create a variable that will apply to all users, choose the “System” option instead.
  6. Click the Add variable button.

    PowerToys add variable

  7. Confirm the name for the new environment variable. For example, “Screenshots.”

  8. Confirm the path for the folder, drive, or file to open with the new variable. For example, “C:\Users\account\OneDrive\Pictures\Screenshots.”

    PowerToys create environment variable

  9. Click the Save button.

After you complete the steps, the tool will create and apply the link to the location or file to the specific name you specified.

Set up a variable profile

A profile is a feature only available in PowerToys that allows you to enable or disable custom environment variables quickly. When using this option, the configuration will apply to the current user, not globally.

To create a profile with variables, use these steps:

  1. Open PowerToys.

  2. Click on Environment Variables.

  3. Turn on the “Enable Environment Variables” toggle switch (if applicable).

  4. Under the “Activation” section, click the “Launch Environment Variables” option.

    PowerToys Environment Variables tool

  5. Click the New profile button.

    PowerToys environment new profile

  6. Confirm the name of the profile.

  7. Turn on the “Enabled” toggle switch.

    Enable profile

  8. Click the Add variable button.

  9. Click the New tab.

    Quick note: You can also add existing configurations from the “Existing” tab.

  10. Confirm the name for the new environment variable. For example, “Screenshots.”

  11. Confirm the path for the folder, drive, or file to open with the new variable. For example, “C:\Users\account\OneDrive\Pictures\Screenshots.”

    PowerToys profile create variable

  12. Click the Add button.

  13. Click the Save button.

Once you complete the steps, the environment variables will apply to the user, and you can use the toggle switch next to the profile to turn on or off the configurations as needed.

You can also add variables to the “system” level. The difference between the “user” and “system” is that the variables for “user” only apply to the current user account that’s logged in, while the “system” configuration applies globally to all users.

Update October 31, 2023: This guide has been updated to add new instructions to create variables with PowerToys.

About the author

Mauro Huculak is a Windows How-To Expert who started Pureinfotech in 2010 as an independent online publication. He has also been a Windows Central contributor for nearly a decade. Mauro has over 15 years of experience writing comprehensive guides and creating professional videos about Windows and software, including Android and Linux. Before becoming a technology writer, he was an IT administrator for seven years. In total, Mauro has over 21 years of combined experience in technology. Throughout his career, he achieved different professional certifications from Microsoft (MSCA), Cisco (CCNP), VMware (VCP), and CompTIA (A+ and Network+), and he has been recognized as a Microsoft MVP for many years. You can follow him on X (Twitter), YouTube, LinkedIn and About.me. Email him at [email protected].