Overview – Set PATH and Environment Variables
Path variables are environment variables that provide the location of a program. The default path variable system in Windows determines the folder where files are looked for. C:\Program Files, C:\Program Files (x86), C:\Users, and any additional directories on your hard disc fall under this category.
Using the methods below, you’ll be able to insert any programming language, compilers, and security keys (python, PHP, c++ compilers, etc) to the path variable in Windows OS. By the end of this article, you’ll be able to add environment variables in Windows 11:
Why To Set PATH Variables in Windows
PATH is an essential environment variable on all Windows operating systems. It determines the way a system executes a program or command on your computer.
Typically, when you have to launch a program or execute a command, you have two options. Either you can navigate to the directory where the program/command is stored and execute it from there. Or, you can use the absolute path for that program/command in the file system to run it from anywhere.
While both approaches let you execute programs or commands via the Command Line Interface (Command Prompt or PowerShell), they aren’t very efficient. A better solution here is to set the PATH variable for those programs or commands in the environment variable so you can access them from anywhere on the file system hierarchy.
1. Set Environment Variables using System Properties
Step 1: In the Start menu, type: “Edit the system environment variables” (without quotation marks) and hit the enter key.

Step 2: Select the “Advanced” tab from the top bar and select the “Environment Variables” button.

Step 3: Double click the “Path” variable in the System Variables section.

Step 4: Click the “New” button, enter the file path and click the “OK” button.

Step 5: Restart your computer to make changes take effect.
Also, you can refresh environment variables without rebooting your system.

2. Set Environment Variables using Command Prompt (CMD)
Step 1: Open the Command Prompt from the Start Menu as an administrator.

Step 2: To list all the path variables type the following command:
“echo %PATH%” or “PATH” (without quotation marks).

Step 3: To add another variable in the path directory, type the command:
setx PATH “%PATH%;C:\Variable\Path\Here“.

Step 4: Restart your computer to make changes take effect.
Also, you can refresh environment variables without restarting your PC.

3. Set Environment Variables using PowerShell
Step 1: Open the Windows PowerShell from the Start Menu as an administrator.

Step 2: To list all the path variables in the PowerShell, type the command: [Environment]::GetEnvironmentVariable(“PATH”)

Step 3: To declare a PATH variable, type the command:
$Variable_Name = “C:\Path-Here\”

Step 4: To add the PATH variable using PowerShell, type the following command:
[Environment]::SetEnvironmentVariable(“PATH”, “$PATH;$Variable_Name”)

Step 5: Restart your computer to make changes take effect.

Check If Environment Variable is Added Properly
Step 1: Open the Command Prompt or PowerShell from the Start Menu as an administrator.
Step 2: To check if the system variable is properly added, type the command:
“echo %PATH%” or “PATH” (without quotation marks). If the path is added properly, you’ll find the PATH variable in the output.
FAQs Related to Path and System Variables
What is the difference between System and User Variables?
The system variables are shared and apply to all users on the computer, whereas the user variables are unique to each profile. For example, you’ve two users on your computer User 1 and User 2. When you add a system variable in User 1’s account, it will also be set in User 2’s account. However, if you set user variable for User 1. it’ll be applicable for it only.
Next Steps
We’ve covered how to set path and environment variables in Windows 11, and the difference between system and user variables in Windows.
PATH can be included in any of the system or user variables. Make sure to restart the computer to refresh the environment variables and make changes take effect. Further, customize the computer’s settings depending on your preferences.
Related Articles
Refresh System Variables Windows
Refresh the environment variables in Windows without rebooting your computer.
Credential Manager in Windows
Manage your web and system passwords in a single place on your computer.
Disable Widgets in Windows 11
Improve your computer’s performance by disabling the Widgets program.