Getting started with environment variables in Windows

Source: Internet
Author: User

1.How can I set environment variables?

There are two ways to set environment variables: the first is to set them in the command prompt run window; the second option is to click the "environment variables" button in the "My Computer → properties → advanced" tab. Note that the first method of setting environment variables is only valid for the current running window. After closing the running window, the setting does not take effect, the second method for setting environment variables is permanently valid.

2.How do I set environment variables in the Command Prompt window?

In the "Start> Run" box, enter "cmd" and press "OK" to display the Command run window. Enter "set" in the command prompt to view the environment variable settings. To view the specific environment variable settings, for example, to view the PATH environment variable settings, you can enter "set path ". To create an environment variable, for example, to create an environment variable named AA with the value of "C:", enter the "set AA = C:" command. To delete an environment variable, for example, to delete the AA environment variable, you can enter the "set AA =" command (note = There is no space at the end ). How can I change the setting of an environment variable? There are two ways to change the environment variable: one is the append method, that is, to increase the value of the variable without changing the existing settings of the environment variable, for example, to add a setting with the value "D:" To the environment variable AA, enter "set AA = % PATH %; D :". The other method is completely modified. For this method, we can directly create an environment variable.

  3.What is the relationship between user variables and system variables?

Click the "environment variables" button in the "My Computer → properties → advanced" tab. The "environment variables" dialog box appears. If you are currently logged on to the system as administrator, in the dialog box above is the user variable of administrator, and below the dialog box is the system variable (that is, the user variable equivalent to all users in the system ). Sometimes we can see that an environment variable exists in both the user variable and the system variable, such as path, so whether the value of path is the value in the user variable or the value in the system variable, or neither of them? The answer is neither of them. The value of the PATH variable is the superposition of the value in the user variable and the value in the system variable.

  4.What should I pay attention to when changing the values of environment variables and environment variables?

Do not contain spaces or Chinese characters for the values of environment variables and environment variables. Remember!

 

Q: view all currently available environment variables (= system variables + User variables)

Answer: Set

Q: Check an environment variable, such as path.

A: set path

Q: Add environment variables, such as xxx = AA.

Answer: Set xxx = AA

Q: Leave the environment variable (such as XXX) empty.

Answer: Set xxx =

Q: Add a new value (such as D:/XXX) after an environment variable (such as path)

A: Set Path = % PATH %; D:/xxx

  

PS: the operations on environment variables in the DOS window using the command line method are only valid for the current window application.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.