Editing PATH in Windows
Environment variables such as PATH help organize computers to make important apps and files easier to access. You can edit PATH using a GUI or with PowerShell.
temporary change with PowerShell
$env:Path
gets the current contents of the PATH variable.$env:Path += ';C:\my\file\path'
appends a file or folder to PATH.$env:Path = 'C:\my\file\path;' + $env:Path
prepends a file or folder to PATH.
Changes to PATH made this way will only last until you close the terminal.
permanent change with a GUI
- Press the Windows key.
- Type
path
and select “edit the system environment variables”. - In the window that pops up, go to the Advanced tab.
- Click
Environment Variables
. - In the user variables (the top box; see below), select the row that has “Path” in the left column.
- Click
Edit
. - Click
New
. - Click
Browse
. - Select the file or folder you want to add to PATH.
- Click
OK
on each of the new windows. - Restart any running terminal for the change to take effect.