How to Add a Path to the PATH Environment Variable in Windows
The PATH environment variable in Windows allows the operating system to locate executable files without needing the full file path each time. Adding a new path to PATH makes it easier to run programs and utilities from the command line. Here’s how to add a new path to PATH in Windows.
Step 1: Open the "Environment Variables" Window
1. Press Win + X and select System, or go to Control Panel → System and Security → System.
2. Click Advanced system settings on the left.
3. In the window that opens, select the Environment Variables... button.
Step 2: Locate the PATH Variable
1. In the "Environment Variables" section, you’ll see two sections — one for user variables and another for system variables. Find the PATH variable in one of these sections, depending on whether the path should be accessible to all users or just the current user.
2. Select the PATH variable and click Edit....
Step 3: Add a New Path
1. In the editing window, click New and add the full path to the folder you want to include in PATH.
2. Ensure each path is added on a new line to avoid errors in the environment variable.
3. Click OK to save your changes.
Step 4: Verify the Changes
Once you've updated the PATH, open the Command Prompt (Win + R → type cmd) and run a command to check if the new path works. For instance, if you added a path to a folder containing python.exe, you can verify it by running python --version
.
Your new path is now added to the PATH variable, allowing Windows to locate programs and utilities in the specified folder.