Different programs and processes require different environments to run. On a single computer, Windows must ensure that all programs and processes can access the required environments.

To do this, Windows needs to know the type of environment each program needs to function. Windows needs to store this information somewhere so that it can be easily accessed. Environment variables make this possible.

In short, environment variables are mechanisms for storing data.

Let's dig a little deeper to see how environment variables work and how you can effectively create, edit, and delete them.

What are environment variables in Windows 10?

Environment variables are dynamic variables that store data related to creating different environments for different programs and processes.

To better understand them, let's take the example of a program that requires a built-in Windows tool to run.

In order for the program to use the tool, the program must know the location of the tool in order to access it. The program also needs to find out whether or not it is authorized to use the tool. There are also things that a program needs to know before it can use the tool.

So a program can access all of this information by asking Windows. Windows then looks for Environment Variables (EVs) for this data and creates an environment in which the program can run.

In other words, EVs store data that can be accessed by any user for any program or process running on the system. The data these variables store helps programs run in the environment for which they were designed.

Some of the most important EVs on Windows are PATH, HOMEPATH, and USERNAME. All of these variables contain values ​​that can be accessed by any user and process in the system at any time. For example, the USERNAME environment variable contains the name of the current user. Windows can look up this variable whenever it needs to find out the name of the current user.

How to set environment variables in Windows 10

First things first: If you want to set up system-wide EVs, you need administrator rights. If you are not the administrator, inform your system administrator and ask for help.

Now that you have administrator rights:

  1. Art Advanced system settings in the start menu search box and select the best match.

  2. In the System Properties box, click Environment variables to open the Environment Variables area.

The EVs panel lists two types of variables as needed. If you only want to change EVs for the current user and you don't want the changes to be reflected system-wide, change yourself User variables.

On the contrary, if you want system-wide changes, you will change System variables.

Suppose you have just installed Java and you want to add the Java path to the EVs. In order to do this:

  1. Click on New under the user / system variables. This opens the New user variable Box.

  2. Enter JAVA_HOME by doing Variable names Field and navigate to the directory where you installed Java to find the path in Variable value.

To press OK adds the JAVA_HOME variable to the PATH variable.

How to edit environment variables

To edit various environment variables, select any variable from the list. Then press To edit. This opens the Edit environment variable Blackboard. Here you can create, delete and edit variables.

From the list of variables, select the one you want to change and click To edit. You can then change the variable value as you wish.

You can also clear the variables in a similar way.

What is the Windows PATH variable and how can I change it?

In simple terms, the PATH variable is an address book of programs and commands on your computer. Whenever you have a new program on your computer that you want to run from the command line interface, you must include its address in the PATH variable.

Related: How to Make a List of All Installed Programs in Windows

Note that not all programs are in the PATH environment variable. Only the programs intended to be used through the command line interface appear in the PATH variable. Programs that are to be used by a graphical user interface do not have their addresses in the PATH variable.

The way the process works involves Windows looking for the address for a specific command. Whenever you enter a command on a command line, Windows first searches the current directory for the command. If the operating system cannot find it in the current directory, it searches the PATH variable to find the address.

Related: How to Set the PATH Variable in Linux

To enter an address in the PATH variable, the process is the same as before. Open the Environment variable Box, select that PATH variable and click To edit.

In the Edit field you can add, remove and edit directories.

One last thing to remember, the PATH variable is not the same for every user on a system. This allows different users to list different directories without changing the variable for each user. So if you want a tool to be available to every user, you have to set the PATH variable under the System variables.

Environment variables in Windows 10 store data that programs need to function

Programs need data to function. To ensure efficient data availability, Windows stores this data in global variables that can be accessed by all programs. These global variables are environment variables.

You can use environment variables in. add, edit and remove Advanced system settings Blackboard.

If you have more than one user on a computer, the user environment variables are different for each user. For example, a user may have a command listed under the PATH variable that is not available to other users.

On the other hand, system EVs are available for all users. These variables require administrator rights to edit or delete.

In short, EVs are Windows' ability to store important data. So make sure you know what you are doing before changing them.

How to add Python to the Windows PATH variable

Learn how to access Python from anywhere on the command line by adding it to your Windows PATH variable.

Continue reading

About the author

Fawad Murtaza
(23 articles published)

Fawad is a full-time freelance writer. He loves technology and food. When he's not eating or writing about Windows, he's either playing video games or writing for his quirky blog, Techsava.

More
By Fawad Murtaza

Subscribe to our newsletter

Subscribe to our newsletter for tech tips, reviews, free e-books, and exclusive offers!

One more step …!

Please confirm your email address in the email we just sent you.