0

Is there a way to permanently modify your PATH from the command line?

I find myself often trying to run a command or two on the DOS prompt, and find out it's not on my path. I manually find the location, use the tool with a long winded path, and forget to add it to my path so I don't have to do that rigmarole again.

Ideally I'd love to say addToMyPath.exe [dir] and it would auto add to my regkey for the path. Anything like that exist?

Dave M
  • 13,138
  • 25
  • 36
  • 47
Eddie Parker
  • 2,824
  • 8
  • 30
  • 37
  • possible duplicate of [Setting and getting windows environment variables from the command prompt?](http://superuser.com/questions/79612/setting-and-getting-windows-environment-variables-from-the-command-prompt), [Is there a way to set Windows environment variables from the command line PERMANENTLY](http://superuser.com/questions/119838/is-there-a-way-to-set-windows-environment-variables-from-the-command-line-perman) – Ƭᴇcʜιᴇ007 Sep 17 '14 at 21:25

1 Answers1

2

Source How to update PATH variable permanently from cmd? by panny:

Use

setx PATH "%PATH%;C:\Something\bin"

The new PATH will not apply to your current cmd.exe.

If you look in the registry or in a new cmd.exe with set path you will see the new value.

See SETX.exe (Resource Kit, Windows 7) for more information on the setx command.

DavidPostill
  • 153,128
  • 77
  • 353
  • 394