For example, there will be 2 notepad.exe

Source: Internet
Author: User

For example, there will be 2 notepad.exe

You may have noticed that there's a copy of Notepad in % windir % \ notepad.exe and another in % windir % \ system32 \ notepad.exe. Why two?

Compatibility, of course.

Windows 3.0 put Notepad in the Windows directory. Windows NT put it in the System32 directory.

Notepad is perhaps the most commonly hardcoded program in Windows. using Setup programs use it to view the Readme file, and you can use your imagination to come up with other places where a program or batch file or printed instructions will hard-code the path to Notepad.

In order to be compatible with programs designed for Windows 95, there needs to be a copy of Notepad in the Windows directory. and in order to be compatible with programs designed forWindows NT, there also needs to be a copy in theSystem32 directory.

And now that Notepad exists in both places, new programs have a choice of Notepads, and since there is no clear winner, half of them will choose the one in the Windows directoryand half will choose the one in the System32 directory, thereby ensuring the continued existence of two copiesof Notepad for years to come.

Translation:

You may have noticed that there is an executable program named notepad.exe in the % windir % \ directory and % windir % \ system32 \ directory. For example, how many notepad.exe programs exist?

This is the reason for compatibility.

Windows puts notepad.exe to the % windir % \ directory, while Windows ntputs notepad.exe to the % windir % \ system32 \ directory.

Notepad may be the most common program in Windows that uses hard encoding (Note: Hard encoding here should refer to the Notepad program path. Many installation programs use Notepad to display Readme files. Of course, you can use any method you think, for example, a single program, a script, or a printable operation instruction can be used to provide the Notepad program path.

To be compatible with programs designed for Windows 95, you must copy the Notepad program in the % windir % \ directory. To be compatible with programs designed for Windows NT, there must also be a copy of the Notepad program in the % windir % \ system32 \ directory.

Therefore, the current result is that there is a Notepad program in both places. Newly Developed programs can have their own choice when using Notepad. The two paths do not have a clear winner. Half of them select the % windir % \ directory, and the other half select the % windir % \ system32 \ directory, the system will continue to ensure that the Notepad program exists under these two directories.

Note:

Some of the replies in the original post are also wonderful. The excerpt is as follows:

Adam 28 Mar 2006 AM

Hmmmm... on NTFS are they both hard links to the same file?
(More importantly, how can I get explorer to tell you this? What's the windows equivalent of 'LS-I '?)

In the NTFS file system, all files in these two directories are hard connected to the same file, and the primary will tell you how to use 'LS-I 'to print the file index.

On my computer, the indexes of these two files are as follows:

Eyal 28 Mar 2006 AM

I 'd say the stupid part here was the demo-to put notepad in different places in win3.0 and winNT.

Yes, I agree with Eyal.

Phys028 Mar 2006 AM

As Brian mentioned, a smart app shouldn't have to worry too much about * where * notepad is. the default path on Windows 2000 and XP has % SystemRoot % \ system32 and then % SystemRoot %, so it wowould pick one of the notepads.
Another option wocould be to run "start yourtextfile.txt", which will launch the text file in the application handler for. txt files.

Physag thinks that a smart program should first find it in the % windir % \ directory, and then find it in the % windir % \ system32 \ directory. Then, open the notepad.exe program. Another method is to use the startcommand to open the TXT file. Then, the system can use the TXT file to process the TXT file.

Indeed, using startcommand to open the. txt file is more compatible than hard-coded files.

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.