What are environment variables?

Source: Internet
Author: User

What is environment variable?

Environment variables are strings containing environment information about the system and the currently logged-on users. Some software programs use this information to determine where to place files (such as temporary files ). 
There is no definite definition of environment variables. Here is an example:
Open "start-> Run", enter "calc" in the dialog box, and press enter to see if "Calculator" is enabled, or enter "calc" in the "command prompt" and press Enter, check whether "Calculator" is enabled ". Now, go to the "C: \ WINDOWS \ system32.pdf" directory, and check whether there is a file named "“calc.exe". Check out other executable files: mspaint.exe, which is the graphic program and notepad.exe is the Notepad program. Do you enter "mspaint" and "Notepad" in "run" or "command prompt" to open "Drawing" and "Notepad" again.
Now, in "run" and "command prompt", enter "QQ" and press Enter. Can I open QQ? No, but prompts "Windows cannot find the program QQ" and "'qq' are not internal or batch processing files .".
How can I open QQ? My QQ is installed in the "C: \ Program Files \ Tencent \ QQ" directory. Now, in "run", enter "cmd" and press Enter. In "command prompt", enter "cd c: \ Program Files \ Tencent \ QQ ", the purpose of this command is to enter the QQ installation directory. Now we can enter "QQ" and press enter to directly Open QQ.
Why do we enter "calc", "mspaint", and "Notepad" to directly open the corresponding program, and Open QQ to enter the QQ installation directory? Now let's take a look at the key links. Right-click "my computer" and select "properties". On the "advanced" tab, click "environment variables ", in "system variables", we can see a variable named "path". We double-click it and we can see that its variable value is "C: \ Program Files \ Rockwell SOFTWARE \ rscommon; % SystemRoot % \ system32; % SystemRoot % \ system32 \ WBEM; C: \ Program Files \ common files \ Autodesk shared \;". The value of this variable is separated by ";". We can see the "% SystemRoot % \ System32" directory, "% SystemRoot %" indicates the "Windows" directory on the system disk. if the system is mounted to disk C, the directory is actually "C: \ windows \ system32respectively, and the preceding descriptions of calc.exe000000000000-mspaint.exe0000and notepad.exe are both in the "C: \ WINDOWS \ System32" directory, but we cannot find "C:" in the "path" variable value: \ Program Files \ Tencent \ QQ ", now you know why the first example is.
Now let's modify the value of the variable "path" and add "; C: \ Program Files \ Tencent \ QQ" at the end of the variable value ", click OK to return to the desktop. Note that there is a ";" in front of the directory to be added, because it should be separated from the previous directory. Now, you can easily Open QQ by entering "QQ" in any directory in "run" and "command prompt.

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.