Win7 file associated file and program "marriage" (1)

  
encountered a friend urgent help: the system is Windows7, this friend because the desktop does not have Office icons, and eager to use WORD, right click on a desktop icon, select Word was selected in the open mode, and the tick before "Always use this program to open the same type of file" is not removed. 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 problem associated with a file. 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.

To solve this problem, we need to talk about some basic knowledge of the file associated with it, in order to make friends, but do know know why.

file association, the main thing is to associate file types with the Open command. Windows recognizes the file type by its extension, which first needs to associate the extension with the file type.

assoc command to modify

associated with the file extension type, we need to use a command: assoc

point on, search, enter cmd, open cmd, in In cmd, type: assoc/? Enter. We can get help with this command. Role

assoc command are two one is associated with the file extension type of display associated with the file extension types, one is rewritten.

Let us take an example to associate the shortcut address the issue.

shortcut extension is .lnk, in Windows, this extension is generally not show up, and if there is, it will be a problem associated files.

we enter in cmd: assoc.lnk, command Enter the result we can get is: .lnk = lnkfile. The result of this command shows that the extension .lnk is associated with the file type lnkfile. Any file with a .lnk extension belongs to the lnkfile file type.

Let us now enter the command: assoc.lnk = lnk, press the Enter key, associated with this extension lnk file types to be rewritten. Then we enter the command: assoc.lnk, press the Enter key, the result of the command we get will be: .lnk=lnk, this result shows that the extension .lnk is already associated with the file type lnk, and no longer Is associated with lnkfile.

this time you go take a look on the desktop, then your extension .lnk all the shortcuts on the desktop displays all out, all the shortcuts are no longer available. When you double-click, you will be prompted: Windows cannot open this file.

Now let us enter: assoc.lnk = lnkfile, press the Enter key, we will find that everything has returned to its original state.

In short, if it is an association between the extension and the file type shortcuts there is a problem, we only need to enter: assoc.lnk = lnkfile, carriage return after the problem can be solved.

Thus, if we know that one right file type name belongs to expand, when the correlation between this extension and the file type of problems, we only need to enter: assoc.ext = filetype, Press the Enter key. 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 there will be a corresponding registry entry in the registry: HKEY_CLASSES_ROOT.ext,

where .ext represents the extension, such as shortcuts The corresponding item is: HKEY_CLASSES_ROOT.lnk, this item has a default value, the data of 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.

fytpe command

we now know how to associate the extension with a file type, and further need to know is how to associate file types with the Open command. 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 type of file open command it? This is an important need to use another command: ftype

let us enter in cmd: ftype /Enter?. We can get help with this command.

ftype command has two functions, one show associations between file types and open command, the association between a file type and open-First rewrite command.
Copyright © Windows knowledge All Rights Reserved