This article is a mirror article of machine translation, please click here to jump to the original article.

View: 10999|Reply: 4

cmd to set the permanent environment variable command

[Copy link]
Posted on 2020-5-26 16:44:33 | | |
set command

The set command is used to set the environment variables in the current cmd window, which is only valid in the current cmd window and will be invalid after the cmd window is closed. It does not affect the user environment variables saved in the system.

For example:


setx command

setx sets the permanent user environment variable

setx env_name env_value

Note: Some paths will have spaces, so it is best to wrap variables and values in double quotation marks, that is, write them in the following form:

setx "env_name" "env_value"

For example, append a path to the user path environment variable:


setx sets a permanent system environment variable

The setx plus /m parameter indicates that the environment variables of the system are set, and the format is as follows:

setx env_name env_value /m

Note: Some paths will have spaces, so it is best to wrap variables and values in double quotation marks, that is, write them in the following form:

setx "env_name" "env_value" /m

For example, set the current path %cd% to the system environment environment variable:


Note: Once the setx environment variable is set, it will take effect in the newly opened terminal, and the current terminal will not take effect immediately.





Previous:Angular 9 implements the duplication (clipboard) feature
Next:Angular ng lint warning warning fix
Posted on 2022-10-9 16:20:35 |
Thank you for sharing!
Posted on 2022-11-13 13:16:39 |
Keep it for later use
 Landlord| Posted on 2023-5-28 19:21:48 |
cmd to set the current directory to the path variable

Posted on 2023-12-7 18:36:47 |
Thank you, learn
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com