Windows System environment variable path priority test report

Source: Internet
Author: User

Transferred from: http://bluekylin.cnblogs.com/archive/2005/12/16/298797.html

I always thought that I was already operating windows, today in its help to see a large unknown command-line tool, but this essay has nothing to do with these tools, but I used a command at the time of the wrong, the result is that I can not help writing something.
When some commands run for a long time (several pages), I often export their results to a text, which is definitely a good habit, for example, to facilitate search:
If I want to find a file in D, I do not know which folder it is in, I will use the tree command to write all the file names of D disk into the text, and then query from the text, faster than the direct search for D disk, and relatively use less system resources. You can try it if you don't believe it.
The command to write all the file names and directory structures of the D drive to the 1.txt of the C drive is the tree d:>c:1.txt
This file can also be saved for later use, if there is no significant update.

Yes, it's far away.: )

Today do not know what is going on, may be deserted, a command of the result output written >cmd, immediately rewrite, and did not care about the written cmd file, and then habitually closed the command line window (I do not know why, knowing that I also want to lose in this window command, but turn it off), view the output, Then learn the use of the next tool, run CMD, stay out, out of the output just now. Only-hair-now, no, only to understand that it was just the loss of the CMD, think of the location of the cmd file, should be in the current User Configuration folder (the default starting position of CMD, this cmd non-cmd), in the, delete the good. Suddenly feel strange, User Configuration folder does not seem to set the PATH environment variable how can directly ...
It should be the highest-level path!

Then it's fun to test the priority of the environment variable path.

Test Path4 A
%userprofile% (system default, current User Configuration folder, Documents and Settings in the current user-named folder, I am currently administrator)
%systemroot% (Windows under XP)
%systemroot%/system32
D:\bat (user-defined path)
Do four files with no extension name "Test", respectively, placed in the above four folders, the content of each test file is set to the folder name

Run test, the first appearance is (the content of the test file shown)
Administrator
(then delete the test file from your folder)
Run test again, the appearance is
System32
(Delete off)
Run test again, the appearance is
Windows
(Delete off)
Finally,
D:\bat
(Delete off)

OK, the results come out, the path priority is arranged from high to Low:
%userprofile%
%systemroot%/system32
%systemroot%
User-defined Path

Use everyone to think, I will not nonsense, summary finished!

Windows System environment variable path priority test report

Related Article

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.