Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

Permanently setting PATH from CMD windows 8

Writer Andrew Henderson

I'm setting up a custom command line utility, and the 'installer' adds a PATH entry. It works after this for the current session. After I close and open the command prompt, the PATH is reset and the command line isn't available any more. What's this about and how do I permanently set it from CMD?

1

1 Answer

How do I permanently set the PATH from a cmd shell?

You need to use setx instead of set.

Example:

SetX PATH "c:\my dir;%PATH%"

Notes:

  • "s are recommended in case any of the path elements contain spaces.
  • The cmd shell should be run as Administrator.
  • Use /m to set the PATH in the system environment instead of the user environment.

Warning:


Further Reading

  • An A-Z Index of the Windows CMD command line - An excellent reference for all things Windows cmd line related.
  • setx - Set environment variables permanently, SETX can be used to set Environment Variables for the machine (HKLM) or currently logged on user (HKCU).

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy