Uncategorized

Adding folders to the PATH in Windows 11

On Windows 11, you can add a folder to your PATH (so its programs/scripts can be run from any terminal) in a couple of ways. Here’s the step-by-step method using the GUI and the command line:


🔹 Method 1: Using System Settings (Permanent)

  1. Open System Properties
    • Press Win + R, type sysdm.cpl, and press Enter.
    • Or: Right-click Start → System → Advanced system settings.
  2. Go to Environment Variables
    • In the System Properties window, click Advanced → Environment Variables.
  3. Edit PATH variable
    • In the Environment Variables window:
      • Under User variables (affects only your account) or System variables (affects all users), find Path and select it.
      • Click Edit.
  4. Add new folder
    • Click New, paste the folder path (e.g. C:\MyTools\bin).
    • Click OK to save.
  5. Restart terminal
    • Close and reopen Command Prompt / PowerShell / Windows Terminal for the changes to take effect.

🔹 Method 2: Using Command Line (Temporary or Permanent)

Temporary (for current session only):

set PATH=%PATH%;C:\MyTools\bin

or in PowerShell:

$env:PATH += ";C:\MyTools\bin"

Permanent (PowerShell, applies to user):

setx PATH "$env:PATH;C:\MyTools\bin"

⚠️ setx has a length limit (~2047 characters) and won’t expand variables like %SystemRoot%.


✅ After doing this, you can type a program name from that folder in any terminal and it will run without needing the full path.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.