New play on environment variables under windows

Source: Internet
Author: User
Tags variables variable root directory
window| variable

Recently found friends playing computer, in the "run" in the input qq.exe,qq will run. I was surprised to find that I had tried to enter QQ.exe in "Run" and not run it. What is this for? Finally in the friend's inspiration I finally got the answer. Here to share with you.

I wonder if you noticed such a place: System variables under System Properties/advanced/environment variables. We double-click the variable path under System variables. The system defaults to only the%SystemRoot%\System32 and%systemroot% two variables, each representing two directories, one for the system root and the other for the System32 directory under the root directory. When we enter QQ.exe in the run, it will look in these two directories (the search order is in the folder writing order), if there is run, no error.

Below let us start to build their own "run", such as QQ installed in the "E:\QQ2" under, and our goal is to directly enter the operation of "QQ" can let it run. How do you do it? Just add a single statement "E:\QQ2" to "path" (Figure 1). OK, now again in the operation of the input QQ, you can directly run the program.

 
A friend might ask: when we enter CMD in "Run" instead of CMD.EXE, how does the system open CMD.EXE without opening cmd.com or cmd.txt? In fact, this is determined by the "Pathext" under "System variables". When we enter CMD in "Run", the system will find a match according to the order of the extension in "Pathext" (Figure 2), and if there is cmd.com, execute the cmd.com without executing cmd.exe or a file with different extensions named CMD. Knowing this rule, we can use it flexibly to get the best results.

  
Tip: System One but find the appropriate file will not go to other environment variables directory to find, so we set the environment variable directory when also be careful.

  

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.