How do I set Windows Environment variables permanently?

蹲街弑〆低调 提交于 2019-11-27 06:57:38

问题


How do I set Windows Environment variables permanently, I see that the Windows environment variables are reset when you close the command window. I want to set them permanently so that I don't have to repeat the task every time I use CLI.


回答1:


Right click on Computer, Advanced system settings, select Advanced tab and click Environment variables.

Note: once you modify the environment variables, you will have to restart your applications, including CLI.




回答2:


This can also be achieved from command prompt. The following example set a variable at user level:

SETX variable_name value

For machine level elevation is required:

SETX variable_name value /m


来源:https://stackoverflow.com/questions/17312348/how-do-i-set-windows-environment-variables-permanently

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!