Environment Variables in Windows 10 and Windows 11

Environment variables are special operating system settings that define values used by various programs and processes. They’re especially useful for developers, system administrators, and users working with the command line or scripts. In Windows 10 and Windows 11, environment variables play a crucial role in configuring the system environment.

What Are Environment Variables?

Environment variables are "name-value" pairs containing information that the operating system and installed programs use. For example, the PATH variable indicates directories where executable files are located, allowing programs to run without specifying the full path.

Essential Environment Variables

Windows 10 and Windows 11 include many standard environment variables, such as:

  • PATH — specifies paths where the system searches for executable files;
  • TEMP and TMP — directories for temporary files;
  • USERPROFILE — path to the current user's profile;
  • APPDATA — directory for storing application data;
  • SYSTEMROOT — root directory of the operating system (usually C:\Windows);
  • HOMEPATH — path to the current user's home directory.

How to Modify Environment Variables in Windows 10 and Windows 11

Modifying environment variables in Windows 10 and Windows 11 can be done as follows:

  1. Open Control Panel or go to System Settings.
  2. Navigate to System > Advanced System Settings.
  3. In the System Properties window, select the Advanced tab and click Environment Variables....
  4. To modify system variables, select the desired variable in the System Variables section and click Edit....
  5. To add a new variable, click New... and enter the variable name and value.
  6. Click OK to save the changes.

Useful Variables for Developers

Certain environment variables can be particularly useful for developers:

  • JAVA_HOME — points to the installed JDK version path for Java development;
  • PYTHONPATH — directory for Python modules that the interpreter uses when importing libraries;
  • NODE_PATH — path for Node.js modules, helpful when working with JavaScript and Node.js projects;
  • COMSPEC — specifies the Windows command processor, by default, cmd.exe.

How to View Current Environment Variables

To view current environment variables, you can use the Command Prompt or PowerShell:

Using Command Prompt

set

This command displays all current environment variables.

Using PowerShell

Get-ChildItem Env:

This command lists all environment variables and their values.