Create User & System Environment Variables in Windows 7 & Windows 8

A while ago we talked about environment variables and their role in Windows operating systems. Did you ever need to experiment with these variables? Or do you want to learn more about how to use environment variables? Then, read this guide and learn how to create your own user & system variables, both in Windows 7 and Windows 8. Creating your own variables may turn out to be useful in certain scenarios.

NOTE: To create environment variables, go to the Environment Variables window. You will learn how to open this window, by reading this guide: Simple Questions: What are Environment Variables in Windows?.

How to Create a User Environment Variable in Windows 7 & Windows 8

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 his Documents, Pictures, Music, etc).

In the User variables section, click or tap New.

How to Create User & System Environment Variables in Windows 7 & Windows 8

The New User Variable window opens. First, type the name of the variable. Make it something suggestive, so that you can easily remember the variable.

Then, type its value. 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 you can use a value like %Userprofile%\Desktop to point the variable to your user account’s Desktop. If you want it to have more than one value, separate the values with ;. For example: Path 1; Path 2; Path 3.

How to Create User & System Environment Variables in Windows 7 & Windows 8

NOTE: It is not mandatory to use only paths to folders and files as the value of an environment variable. Depending on what you want to do with the variable, you can also store strings of text as a value.

When you are done setting the user variable, click or tap OK. The new variable is listed in the list of user variables but it is not yet created and you can’t use it, yet.

How to Create User & System Environment Variables in Windows 7 & Windows 8

In the Environment Variables window, click or tap OK, so that the new environment variable is created.

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 % signs. For example, to execute the 7Tutorials variable I just created, I needed to type %7Tutorials%. Then, I pressed OK.

How to Create User & System Environment Variables in Windows 7 & Windows 8

In my case, it opened the _7tutorials folder found in my user’s Documents library.

How to Create a System Environment Variable in Windows 7 & Windows 8

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

In the System variables section, click or tap New.

The New System Variable window opens. Complete the name of the variable and its value. You can add multiple values to a variable. All you need to do is separate them with ;.

How to Create User & System Environment Variables in Windows 7 & Windows 8

Remember: if you are specifying 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, then 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 listed in the list of system variables but it is not yet created.

How to Create User & System Environment Variables in Windows 7 & Windows 8

In the Environment Variables window, click or tap OK, so that the new environment variable is created.

To test if the user variable was created successfully, open a Run window (Windows + R).

Type the name of the environment variable you just created, between % signs. For example, to run the Games variable I just created, I needed to type %Games%. Then, I pressed OK.

How to Create User & System Environment Variables in Windows 7 & Windows 8

Windows opened the Games folder where all games are installed on my computers. All users have access to this folder and they can use this variable to quickly access those games.

Conclusion

The process involved for creating environment variables in Windows 7 and Windows 8 is not complicated. However, before you get the hang of it, you should experiment first by creating a couple of safe user variables, that don’t negatively impact the functioning of the system.