From: http://blog.goods-pro.com/146/%E8% AE %A9%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E7%94%9F%E6%95%88%E4%B8%8D%E9%9C%80%E9%87%8D%E5%90%AFwindows/
First, go to my computer> Properties> advanced> environment variables, add new environment variables or modify existing environment variables, and then run "doscommand prompt" or run cmd. If you want to modify the PATH variable, no matter what the original value of path is, change the path to any value in the DOS window and close the DOS window, my computer> Properties> advanced> environment variable path has taken effect globally in windows.
Do not worry that changes in the DOS window will affect my computer> Properties> advanced> environment variables. The environment variables in the DOS window are only a copy of the Windows environment variables, changes to the copy will not affect the original, but will trigger the refresh of the original, which is exactly what I want-to make the environment variable take effect
Note:
Do not know how to modify environment variables in DOS? It is very simple. For example, to modify the path, "set Path = c: \", there should be no spaces on both sides of the equal sign. PATH environment variables are the most commonly used. Specifically, there is a doscommand path used to view and modify the PATH value. Here we will not expand the path syntax.
Want to verify whether the environment variable has taken effect? Very simple. Open a new DOS window, for example, to view the PATH value, "Echo % PATH % ". Similarly, you can use the path command to view the path.