Is there a convenient way to edit PATH in Windows 7?

167

61

I do not understand why Windows 7 is still adopting this stuffy dialog box? I feel uncomfortable when editing and looking-up a path in this narrow text box.

enter image description here

Is there a convenient way to edit PATH in Windows 7? One item per row for example.

xport

Posted 2011-06-16T08:29:34.270

Reputation: 2 075

You need to define "convenient". The dialog works fine for adding to the PATH (just append it); adding other envars; and deleting envars. In your case, you could copy the string to Notepad or Notepad++, edit it, and then paste it back. Its as simple and convenient as <kbd>CTRL</kbd> + <kbd>C</kbd> and <kbd>CTRL</kbd> + <kbd>V</kbd> (that's what I do). – jww – 2014-08-12T01:48:40.950

@Chris2357: using setx for the path is problematic. See http://stackoverflow.com/questions/19287379/how-do-i-add-to-the-windows-path-variable-using-setx-having-weird-problems

– El Ronaldo – 2014-09-19T17:25:53.090

1Windows 8 now too of course. Fingers crossed for Windows 10. – user74094 – 2015-02-24T22:10:30.560

This doesn't deserve to be an answer, but I made this gist: https://gist.github.com/examinedliving/6251286 that splits the output of the path variable (or any other environmental variable) into seperate lines for easy viewing from the command line. Makes it much easier to see what needs to be edited.

– dgo – 2015-09-16T03:40:27.460

2

@user74094: Microsoft has delivered this feature in Windows 10 preview build 10565, release build 10586: http://www.geek.com/microsoft/microsoft-finally-makes-the-windows-environment-variable-editor-usable-1637831/

– bwDraco – 2015-11-15T09:05:49.480

The best answer is update to Windows 10 if you can. – Devid – 2016-07-13T09:06:55.157

1This is a great question; that stuffy box also seems to have a character limit which can prevent you from making the modifications you want. – rkagerer – 2018-01-31T21:57:33.170

Answers

135

There is always the Rapid Environment Editor which claims full support for all major OS versions, including 64-bit.

Editable tree

Show environment variables and values as an editable tree.

Portable mode

RapidEE doesn't require installation and could be run as a "portable application". View details.

rapid environment editor shot

There is also the older (but still useful) and more light-weight Path Editor. (Note that the site is dead as of 2015-08-07, but still exists as an archive.org snapshot from 2013-03-27direct link to the installer). It works just fine on Windows 7 and, though it comes only as an installer, also works as a portable/stand-alone executable if you extract it.

Path Editor is a small utility that makes path management very straightforward with its intuitive user interface and drag-and-drop simplicity. Path Editor can clean your path of missing and duplicate entries with a single click of the mouse.

path editor shot

Mokubai

Posted 2011-06-16T08:29:34.270

Reputation: 64 434

@Dims This is the current link to Path Editor

– MarianD – 2017-04-15T15:21:04.463

@MarianD, that’s actually a different program altogether, described in user2496012’s answer (#615584). I think it was written to be a spiritual successor of sorts, but it's definitely not the same. The "Path Editor" (with a space) linked in this answer was originally written by Redfern Software in 2012, and although it's showing its age, it's still my favorite of the bunch simply because it's the most light-weight option that allows pasting paths from the clipboard. IIRC, very few of the others support that functionality. – Mark G. – 2017-05-12T18:02:07.213

@MarkG. - thanks for your notice! I downloaded it and I will it try. – MarianD – 2017-05-13T11:10:30.077

Worth Mentioning On Windows 7 x64 you also need to restart the windows for the changes to take effect. Shortcut would be to kill Explorer.exe and run it again. – Mehrad – 2017-10-11T02:01:19.220

5Although it's perhaps not totally clear from the REE screen shot, REE can edit individual %PATH% entries (move up/down, highlight missing, add/delete), not just treating it as a string. Really nice app! – GaryO – 2013-01-31T13:41:23.377

2PathEditor link is obsolete. Page on SoftPedia is a link farm which is unable to download PathEditor. – Dims – 2013-06-06T10:27:18.613

45

Here's another Windows Path Editor:

Screenshot

(Disclaimer: I made this. It's open source, contributions welcome!)

rix0rrr

Posted 2011-06-16T08:29:34.270

Reputation: 801

Although it shows many Windows defaults entries as "problematic" + it has no add button (drag&drop from Windows Explorer is fine, however, would really like an Add button in addition): I really liked it, thank you very much! – D.R. – 2014-06-25T11:31:39.233

This wants to completely wipe my User Path, presumably because it's all redundant with the System Path? Is that wise? – endolith – 2015-02-27T02:09:00.597

1Looked good, especially liked the "show problems" feature but it mangled and lost some paths when I saved :( – Empyrean – 2015-04-26T02:52:33.393

Crashes on startup with a "PathTooLongException was unhandled" message. Shame. From reading other threads I believe there is another windows API which can handle longer paths... just not the one used by Explorer (and this utility, evidently) – Greg Woods – 2015-07-02T16:15:52.683

Tip: to copy a path to the clipboard, right click | Open | click in the Windows Explorer address bar | Ctrl+C – Bob Stein – 2016-02-18T20:28:07.143

great utility - thanks. just used it to resolve this issue: http://stackoverflow.com/questions/36777236/running-app-engine-local-development-server-from-command-prompt-v1-9-36-goog/36777360#36777360

– tom – 2016-04-22T18:08:33.297

great util, thanks! It's just missing a 'refresh' button to reload after some external tool alters the path. I might contribute this feature if I find some time. – dss539 – 2016-08-09T17:28:30.033

4+1 Kudos for the "show problems" feature (should be "show potential problems"). It think the buttons actions should open dialogs to explain/ask-for-options/execute. The "Automatic" dialog could have a "maximum depth" (or a folder tree selector), and with a result list with checkboxes to add them to the user or sytem path. Ah, it's so easy to tell other people how things _should_be :-) – leonbloy – 2013-05-30T18:19:34.553

16

This is implemented in the Windows 10 update released on November 2015.

I understand the question specifically calls for a Windows 7 solution. However, I've posted this answer for the benefit of users who happen to come across this question.

Windows 10, in preview build 10565 and release build 10586 (November 2015 update), has an overhauled environment variable editor which dramatically eases editing PATH.

New environment variable editor in Windows 10 update

bwDraco

Posted 2011-06-16T08:29:34.270

Reputation: 41 701

<ctrl><+> should increase font size... it doesn't. – Pacerier – 2017-07-29T07:55:44.383

Did you respond to the correct answer? This doesn't seem to be related to the question or answer. – bwDraco – 2017-07-29T14:11:48.643

Wow, I had no clue Microsoft actually did this. I've used Windows all the way from Windows 95 so I was under the hard impression that the useless dialog box is never going to change. Thank you, this saves me from having to install another piece of software. – ADTC – 2017-10-30T23:55:04.687

Changes (still) only become effective not after editing, but after closing the Environment Variables window with OK (Windows 10 Home 1709). – handle – 2018-04-09T07:18:12.503

15

Environment variables editor (Eveditor) is also worth mentioning. It is easy to use and completely free.

Note: Image shows the Path expanded which it did not do on Windows 7 elevated.

Eveditor

Dmitry

Posted 2011-06-16T08:29:34.270

Reputation: 356

14

For quick and dirty, copy and paste into Notepad then edit and copy and paste back.

Chris Nava

Posted 2011-06-16T08:29:34.270

Reputation: 7 009

@ChrisNava idd it will not. I would recommend Sublime Text 3 :) – Bruno Gelb – 2014-06-23T04:06:35.390

2Assuming you have gnutils echo %path% | tr ; \n is a command-line equivalent of Chris' suggestion. – RJFalconer – 2014-10-24T14:05:59.380

Copy/Paste to notepad++ because my path was long and notepad was messing up splitting the path in two lines pasting it back was trimming it. – zar – 2015-08-31T19:52:41.623

Assuming you don't have gnuutils, do as I do: echo %path:;=◙%. That is a newline character which you can type as ALT+10 (on the numpad). Or just copy-paste from here. – Amit Naidu – 2016-10-15T05:10:49.040

+1: Good idea, but it is still painful to scroll horizontally. – xport – 2011-06-16T16:52:03.737

3I agree. Depending on your editor of choice you could swap ";" for a return and do your editing then swap them back. Notepad will not do that substitution though. :-( – Chris Nava – 2011-06-16T17:41:15.827

9

you might consider this https://patheditor2.codeplex.com/ It does not depend on .Net bloat nor MFC; pure Win32; binary size is less than 200kb. No installation is required and it is a standalone executable. If it matters, it is open source

screenshot

user2496012

Posted 2011-06-16T08:29:34.270

Reputation: 91

I like this best because it is standalone, quick, and pretty easy--but there's no copy-paste of file paths or drag-n-drop yet. – wordsforthewise – 2015-07-31T02:11:34.957

Simple and does what it claims. No. 1! – Ghasan – 2016-04-07T02:43:29.010

Look like there's a convenient github repo right there.

– antogerva – 2018-08-18T23:23:12.467

7

There's a pretty good open source CLI tool called pathed. Usage patterns are like so:

C:\Projects\2010\GSharpTools_Setup\bin>pathed /?
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

C:\Projects\2010\GSharpTools_Setup\bin>pathed
PATHED - Version 3.2
Freeware written by Gerson Kurz (http://p-nand-q.com)

00 C:\Perl\site\bin
01 C:\Perl\bin
02 C:\Windows\system32
03 C:\Windows
04 C:\Windows\System32\Wbem
05 C:\Python26
06 C:\Tools
07 C:\Windows\System32\WindowsPowerShell\v1.0\
08 C:\Program Files (x86)\TortoiseSVN\bin
09 C:\Program Files\TortoiseSVN\bin
10 C:\Program Files (x86)\doxygen\bin
11 C:\Program Files (x86)\WinMerge
12 C:\Program Files (x86)\Subversion\bin
13 C:\Program Files (x86)\p-nand-q.com\GSharpTools [INVALID]
14 C:\Program Files (x86)\p-nand-q.com\pserv2 [INVALID]
15 C:\Program Files (x86)\OpenVPN\bin
16 C:\Windows\Microsoft.NET\Framework\v3.5
17 C:\Windows\Microsoft.NET\Framework\v2.0.50727
18 C:\Program Files (x86)\Scintilla Text Editor
19 C:\Program Files\7-Zip
20 C:\Program Files (x86)\PostgreSQL\8.4\bin
21 C:\Program Files (x86)\Java\jdk1.6.0_18\bin
22 C:\Program Files (x86)\IZArc
; pathed /REMOVE "%CD%"
; pathed /APPEND "%CD%"
; pathed /MACHINE
; and so on.

You'll need to run it as Administrator for the changes to take affect, though.

Ehtesh Choudhury

Posted 2011-06-16T08:29:34.270

Reputation: 1 330

3

A quick and easy way to edit PATH from the command line:

C:\WINDOWS>setx PATH "PATH;C:\some_new_path"

This will update the PATH by appending the new path to the existing path value. Typing the following command will print the new PATH in all future CMD windows; NOT in the current CMD window:

C:\WINDOWS>PATH

Typing the following will give you a list of all the environment variables:

C:\WINDOWS>set

Chris2357

Posted 2011-06-16T08:29:34.270

Reputation: 33

4Warning: this method seems to limit paths to 1024 characters. If your path is already longer, it will simply truncate the end of your path, leaving you with a broken state. – Neil – 2015-12-03T20:30:14.633

1

Solution for Windows 7:

  1. download and install AutoHotKey

  2. copy this script to somewhere on your system: SysEnv.ahk

  3. Right-click the SysEnv.ahk file you just created, and choose "Compile Script"

  4. Right-click the SysEnv.exe file that was just created, and choose "Run as Administrator"

  5. Use the app to edit the PATH, e.g. SysEnv AutoHotKey Window

roblogic

Posted 2011-06-16T08:29:34.270

Reputation: 131

0

Here is an Online Tool for editing windows path, if you don't want to install software.

Daniel Hári

Posted 2011-06-16T08:29:34.270

Reputation: 144