How to change the open file of win7 file

  
A friend urgently ask for help: the system is windows7, this friend has no OFFICE icon on the desktop, and is anxious to use WORD, right click on a desktop icon, select the word in the open mode And did not put the "lever use this program to open the same type of file" before the hook. After this change, all the shortcuts turned out to be word documents. Can be changed to something else, such as the change to Notepad mode, but there is no way to restore the original. This is a file association issue. Such a problem is simply not possible under xp. It seems that this specific problem is a new problem under win7. I searched the Internet roughly and found that it was not just this friend who appeared to have such a problem. It seems that there is a need for a solution. In order to solve this problem, we need to talk about some basic knowledge of file association so that our friends can know what they know. File associations, the main thing is to associate file types with open commands. Windows recognizes the file type by its file extension. This first needs to associate the extension with the file type. Assoc command to modify the extension and file type association, we need to use a command: assoc point to start, search, enter cmd, open cmd, enter: assac /? in cmd Enter. We can get help with this command. The assoc command has two functions. One is to display the association between the extension and the file type, and the other is to rewrite the association between the extension and the file type. Let's take a shortcut as an example to illustrate this problem. The extension of the shortcut is .lnk. Under Windows, this extension is generally not revealed. If it appears, it must be associated with a file. We enter in the cmd: assoc.lnk carriage return, the command result we can get is: .lnk=lnkfile The result of this command shows: the extension .lnk is associated with the file type lnkfile. Any file with a .lnk extension belongs to the lnkfile file type. Now let's enter the command: assoc .lnk=lnk and press Enter. The .lnk extension is associated with the file type. Then we enter the command: assoc.lnk to enter. The result of the command we get will be: .lnk=lnk The result shows that the extension .lnk is already associated with the file type lnk and is no longer associated with the lnkfile. At this time, you go to the desktop to see it. The suffixes .lnk of all the shortcuts on your desktop are all displayed, and all shortcuts are no longer available. When you double-click, you will be prompted: Windows cannot open this file. Now let's type: assoc .lnk=lnkfile and press Enter. We will find that everything has returned to its original state. In short, if there is a problem with the association between the extension's extension and the file type, we only need to type: assoc .lnk=lnkfile to solve the problem after the carriage return. Thus, if we know the correct file type to which an extension belongs, when there is a problem with the association between the extension and the file type, we only need to type: assac.ext=filetype to enter. This .ext represents the file extension, such as .lnk, which represents the file type, such as lnkfile. If we don't know what type of file the extension is associated with, we just need to type in the cmd: assoc.ext to enter. We can get what the file type it is associated with. Each registered extension will have a corresponding registry key in the registry: HKEY_CLASSES_ROOT\\.ext. The .ext here represents the extension. For example, the shortcut corresponds to the item: HKEY_CLASSES_ROOT\\.lnk A default value, the data for this default value, is the file type associated with this shortcut. Therefore, the assoc command, the main thing is to modify the default value of this item. However, it should be noted that the content modified by the assoc command is not only the default value of the item, it will also modify other aspects. So we change the value of this value directly in the registry, and can not completely replace the assoc command. The fytpe command now knows how to associate extensions with file types. What further needs to be known is how to associate file types with open commands. For example, the file type associated with the .txt extension is txtfile. When the txtfile is normal, it is always opened with notepad.exe (Notepad). This notepad.exe is an open command that opens the txtfile file type. How to modify the association between this file type and open commands? This requires another important command: ftype Let us type in the cmd: ftype /? Enter. We can get help with this command. The ftype command has two functions. One is to display the association between the file type and the open command, and the other is to rewrite the association between the file type and the open command. If we want to know what type of file is associated with an open command, we just need to type in the cmd: ftype fileType carriage return. We can get the results we want. This fileType represents the specified file type, such as lnkfile Let us enter: ftype lnkfile carriage return. Under normal circumstances, we get the result of the command: the file type “lnkfile” is not found or the open command associated with it. This result indicates that lnkfile is not associated with any open command under normal circumstances. Let us type: ftype lnkfile=notepad.exe Enter. Let us enter: ftype lnkfile carriage return, we will get the command result: lnkfile=notepad.exe This result shows that the file type lnkfile is associated with the open command notepad.exe. In this case, it still does not affect the opening of the shortcut.
Copyright © Windows knowledge All Rights Reserved