PDF download Download Article
A simple guide to adding directories to the system or user path variable
PDF download Download Article

The PATH environment variable specifies which directories the Windows command line looks for executable binaries. If you want to edit the PATH on Windows 11 or Windows 10, the process is easy, though not obvious at first. Read on to learn how to add, remove, and edit directories in the system PATH and user PATH environment variables on a Windows PC.

Editing the Path in Windows 11 & 10

1. Right-click the Start menu and select System . 2. Go to Advanced system settings > Environment Variables… 3. Select PATH under "System variables" or "User variables." 4. Click Edit . 5. Click New . 6. Enter the directory path and click OK .

Method 1
Method 1 of 2:

Using Advanced System Settings

PDF download Download Article
  1. Right-clicking the Start menu brings up the Power User menu, which has different options. You can also get to this menu using the keyboard shortcut Control + X .
  2. You will see this option in the "Related links" section on the right panel. This opens the System Properties panel to the "Advanced" tab.
    Advertisement
  3. This button is near the bottom of the window, below the "Startup and Recovery" section.
  4. Alternatively, if you only want to edit the path for your user account, not the entire system, select Path under "User variables" instead.
    • You may have to scroll down to find the Path variable.
  5. This takes you to a screen where you can edit the PATH environment variable.

    Warning! DO NOT remove any variables unless you know what you're doing.

  6. You'll see this button at the top-right corner of the window.
    • If you want to edit an existing folder path, select it and click Edit instead. Then, modify the path as needed and click OK to save your changes.
    • To remove a directory from the PATH, select it, then click the Delete button.
  7. Type the full path to the directory you're adding. For example, if you're adding FFmpeg to your path, you'll usually want to add C:\ffmpeg\bin. For Java , it'll usually be something like C:\Program Files\Java\jdk-23\bin.
  8. Keep clicking OK until you've closed out of System Properties completely.
  9. If you were working in an existing Command Prompt window, you'll need to close it and open a new one to verify that you've added the path correctly. Once you're there, type echo %PATH% and press Enter –you should now see the folder you added to your path in the list.
    • Alternatively, if you're using PowerShell , you can echo the path using the command $env:Path -split ';' .
  10. Advertisement
Method 2
Method 2 of 2:

Using Command Prompt

PDF download Download Article
  1. If you want to add a directory to the system PATH in CMD, it's super easy. To open Command Prompt as an admin , click the Start menu, type cmd , right-click Command Prompt , and select Run as administrator .
    • If you're just editing the user PATH and not the system PATH, you don't need to open Command Prompt as an administrator.
    • Important: Editing the PATH environment variable from the Command Prompt using the setx command is not typically recommended–setx merges the system and user PATHs and truncates the PATH to 1024 characters. If the directories in your PATH amount to more characters than that, you'll likely break things. When possible, use Advanced System Settings instead.
    • If you're on a school or work computer and don't have permission to edit the PATH environment variable, ask your system administrator if there's a utility installed to do this, such as pathman or pathed .
  2. If you don't need to make the change for all users of the system, the syntax is setx "%path%;C:\directory" . Replace C:\directory with the full path of the folder you want to add to the path.
    • For example, if you're adding JDK23 to your path, use setx "%path%;C:\Program Files\Java\jdk-23\bin" .
    • This change will not take effect in the current Command Prompt window–you will need to open a new Command Prompt window to test your change.
  3. To make it so the directory you are adding is added to the path for all users of the system, you'll run the same command, but with the /M parameter. For example, setx /M "%path%;C:\Program Files\Java\jdk-23\bin" adds C:\Program Files\Java\jdk-23\bin to the PATH for all users of this system.
  4. If you were working in an existing Command Prompt window, you'll need to close it and open a new one to verify that you've added the path correctly. Once you're there, type echo %PATH% and press Enter –you should now see the folder you added to your path in the list.
  5. Advertisement

Expert Q&A

Ask a Question
      Advertisement

      Video

      Tips

      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Name
      Please provide your name and last initial
      Thanks for submitting a tip for review!

      Warnings

      • Changing the PATH environment variable incorrectly can cause your system to stop working correctly. Before changing PATH, you should have a basic understanding of what you're doing.
      Advertisement

      About This Article

      Thanks to all authors for creating a page that has been read 106,712 times.

      Is this article up to date?

      Advertisement