How to create user and system environment variables in Windows

tutorial
How to create user and system environment variables in Windows

Environment variables are user variables or Windows system variables that describe the environment in which apps run. They can tell your apps things like the name of the computer, the name of the user account, the current working directory, etc. Do you want to know more about how to use environment user variables and Windows system variables? If you do, read this tutorial and learn how to create environment variables in Windows 11 and Windows 10. There are some situations when knowing how to do that can prove very useful.

Advertisement

Things you should know before creating environment variables in Windows

There are two things you should know before following any of the steps shown in this guide to create user and system variables pointing to a folder, file, or anything else. The first and the most important one is to understand what environment variables are. Secondly, you should know the differences in user variables vs. system variables in order to be able to decide what kind of variable you should create. For answers and explanations on these matters, I recommend you read this article before going ahead with the instructions below: What are environment variables in Windows?.

Environment user and system variables in Windows

Environment user and system variables in Windows

Then, once you understand what environment variables are and once you know what type of variable you want to create, you’ll have to open the Environment Variables window. If you’ve read the tutorial I recommended in the previous paragraph, you already know how to do it. However, if you didn’t have time for that, know that an easy method of launching the Environment Variables is to use the search.

If you’re using Windows 11, click or tap the search box (or button) on your taskbar, type environment, and click or tap the “Edit the system environment variables” result.

How to open the Environment Variables in Windows 11

How to open the Environment Variables in Windows 11

The same applies to Windows 10. Click or tap on the search box on the taskbar, enter environment in the search box, and select “Edit the system environment variables” in the list of results.

How to open the Environment Variables in Windows 10

How to open the Environment Variables in Windows 10

Then, the steps to create user variables or system variables are the same regardless of the operating system you’re using. As you can see in the next picture, even the Environment Variables window is identical in Windows 11 and Windows 10.

Environment Variables in Windows 11 vs Windows 10

Environment Variables in Windows 11 vs Windows 10

Without further ado, here are the steps to create environment user variables and system variables in Windows:

Advertisement

How to create environment user variables in Windows

User environment variables are available only to your user account. When creating such variables, their values should include paths towards locations that are accessible to your user account. For example, you can’t have your user variable point to a personal folder of another user account (like Documents, Pictures, Music, etc.). In the “User variables for [user account]” section, click or tap New.

The Environment Variables window

The Environment Variables window

The “New User Variable” window opens. Start by typing the name of the variable you want to create (1). Make it something suggestive to easily remember its purpose. Then, type its value (2). The value may include a path or more. A path can point to a folder or a file. You can also use other existing variables to build up the path you want. For example, if you want the variable to point to the folder used by Steam to save your games, you can set its value like this:

%programfiles(x86)%\Steam\steamapps\common

Entering the name and value of a new user variable

Entering the name and value of a new user variable

TIP: If you want your environment user variable to have more than one value, separate its values with semicolons (;) — for example, Path 1; Path 2; Path 3. Oh, and it’s not mandatory to use only paths to folders and files as values for user variables. Depending on what you want to do with the variable you create, you can also store strings (text) as its value.

Advertisement

When you are done setting the user variable, click or tap OK. The new variable is added to the list of user variables, but it is not yet created, so you can’t use it at this time.

The new user variable has been added to the list

The new user variable has been added to the list

To create the new user variable, click or tap OK in the Environment Variables window.

Saving the new user variable in Windows

Saving the new user variable in Windows

To test if the user variable was created successfully and that it points to what you want, open a Run window (Windows + R). Type the name of the environment variable you just created between percent (%) signs. For example, to execute the steamgames variable that I just created, I have to type:

%steamgames%

Then, click or tap on OK. In my case, this action opens the folder that contains all the games I have downloaded and installed from my Steam account.

Checking a user variable in Windows

Checking a user variable in Windows

IMPORTANT: Any user can add, change, or delete user environment variables. User variables can be created by Windows 11 or Windows 10, apps, and users alike.

Advertisement

How to create Windows system variables

The process for creating system variables is the same as for creating user variables. To make sure you get it right, I’ll go through another quick example.

In the System variables section from the Environment Variables window, click or tap New.

Starting the process of creating a new Windows system variable

Starting the process of creating a new Windows system variable

The New System Variable window opens. Enter the variable’s name (1) and value (2). In the next screenshot, for instance, you can see that I chose to create a new system variable called games that points to a folder called Games on my C: drive.

Entering the name and value of a New System Variable

Entering the name and value of a New System Variable

TIP: Note that you can add multiple values to a variable - all you need to do is separate them with semicolons (;). Also, keep in mind that if you specify a path as a value for a system variable, that path should be accessible to all user accounts. If that path points to a location where only one user account has access, you should create a user variable instead of a system variable.

When you are done customizing the new system variable, click or tap OK. The new variable is added to the list of system variables, but it is not yet created.

The Windows system variable has been added to the list

The Windows system variable has been added to the list

In the Environment Variables window, click or tap OK to create the new environment variable.

Saving a new Windows system variable

Saving a new Windows system variable

To test if the system variable was created successfully, open Run (Windows + R) and insert the name of the environment system variable you created between percent (%) signs. For example, to run the games variable that I created, I must type:

%games%

Then, press the OK button.

Verifying a Windows system variable

Verifying a Windows system variable

In my case, Windows opened the Games folder where I keep most of my games. All users have access to this folder, and they can use this variable to access those games quickly.

IMPORTANT: Are you wondering whether any user can add system environment variables or change existing ones’ values? The answer is NO! Only administrators can perform these actions. Standard users don’t have enough clearance to make or change Windows system variables because they affect every user and every app on the PC. If you’re using Windows 11, this tutorial provides more details about standard and administrator accounts: How to change the Administrator account on Windows 11. And, if you have Windows 10, read this guide instead: 6 ways to change an account to Administrator and back in Windows 10.

What user variables or Windows system variables did you create?

The process involved in creating environment variables in Windows is not that complicated. Furthermore, it’s the same in Windows 11 and Windows 10. However, before you get the hang of it, you should first experiment by making a couple of safe user variables that don’t negatively impact the system’s proper operation. If you have questions about environment variables or if you have something to add to this guide, don’t hesitate to leave me a comment. Also, if you want to receive news whenever we publish new articles, do subscribe to our newsletter using the form below.

Discover: Productivity System Tutorials Windows