Editing the PATH environment variable in Windows is unpleasant: It takes several steps to get to the interface, and, once you get there, it is almost impossible to use:
Something you can do to make the task easier is copy the whole field, edit it in a text editor and then paste it back. But there are better ways.
Here I suggest four alternative tools for editing the PATH and other environment variables. Two are command-line tools and the other two have a graphical interface. All are available for free. I list them in order of personal preference.
pathed
I like pathed the most because it is the simplest. pathed is a command-line tool, part of the GTools collection. Its usage is straightforward:
C:\Users\demetris>pathed --help
PATHED - Version 3.2
Freeware written by Gerson Kurz (http://p-nand-q.com)
USAGE: PATHED.EXE [OPTIONS]
OPTIONS:
/MACHINE: print machine PATH
/USER: print user PATH
/ADD: add variable at the head
/APPEND: add variable at the tail
/REMOVE: remove path / index
/SLIM: strip duplicate vars
/ENV: environment variable, defaults to PATH
For example, say that your Sysinternal tools are in C:\Bin\Sysinternals and you want to add them to the PATH. Simply do:
pathed /append C:\Bin\Sysinternals /machine
To add them to the user PATH system instead:
pathed /append C:\Bin\Sysinternals /user
If you want to know what’s in the PATH before you start editing, pathed does that equally well. Typing pathed without any arguments gives you a clean readable list of the machine PATH:
C:\Users\demetris>pathed
PATHED - Version 3.2
Freeware written by Gerson Kurz (http://p-nand-q.com)
00 C:\Windows
01 C:\Windows\system32
02 C:\Windows\System32\Wbem
03 C:\Windows\System32\WindowsPowerShell\v1.0\
04 C:\Program Files\Common Files\Microsoft Shared\Windows Live
05 C:\Program Files\SlikSvn\bin\
06 C:\Program Files\TortoiseHg\
07 C:\Program Files\TortoiseSVN\bin
08 C:\Program Files\Windows Live\Shared
09 C:\Bin
10 C:\Bin\GTools
NOTE. GTools does not add its own directory to the PATH automatically. I find it makes sense to add it yourself, so that you can use the individual tools quickly from everywhere.
PathEditor
If you prefer something with a graphical interface, PathEditor is an equally simple and straightforward editor and viewer:
PathEditor also offers an advanced mode. To learn about that, look at the program’s manual.
Path Editor homepage and PathEditor manual
Rapid Environment Editor
If you need more than what pathed or PathEditor offer, Rapid Environment Editor is a feature-rich viewer and editor for all environnent variables:
I have not used or Rapid Environment Editor extensively and cannot evaluate it properly. It seems to be a carefully made application. The fact that it has been translated in 13 languages, all by volunteers, suggests that it is appreciated by lots of people.
Rapid Environment Editor homepage
Other
For Windows XP and Windows Server 2003, another alternative is pathman, a command-line path manager included in the Windows Server 2003 Resource Kit Tools that lets you add and remove directories to and from the user PATH and the system PATH. While not as helpful as pathed, the other CLI tool in this list, pathman is certainly better than the default edit box.
Please note that Windows Vista, Windows Server 2008 and Windows 7 are not officially supported by the 2003 Resource Kit Tools. For these versions of Windows select one of the other three path editors.
Links
To recap:
- pathed is a CLI path editor and viewer, part of the GTools set
- PathEditor is a simple GUI path editor and viewer
- Rapid Environment Editor is a feature-rich GUI editor and viewer for all environment variables
- pathman is a CLI tool by Microsoft, part of the Windows Server 2003 Resource Kit Tools