If we want to know which file type is associated with an open command, we just need to type: ftypefileType in cmd and press Enter to get the result we want.
this fileType represents the specified file types, such as lnkfile, we enter: ftypelnkfile, press the Enter key, the command results under normal circumstances we get is: do not find the file type "lnkfile" or associated The open command, this result indicates that lnkfile is not associated with any open command under normal circumstances.
let us enter: ftypelnkfile = notepad.exe, press the Enter key, then enter: ftypelnkfile, press the Enter key, the command result we will get is: lnkfile = notepad.exe The results show : The file type lnkfile is associated with the open command notepad.exe. Under
this case, is still open and will not affect the shortcut. So how do you clear this association and not associate it with other open commands? We just type: ftypelnkfile= and press Enter.
under xp, this command has no effect, however, we can enter in xp: ftypelnkfile =, press the Enter key, the command before a command is almost no difference in appearance, the difference lies in The previous command has no spaces after the =, and the latter command has a space after the =.
let us enter: ftypetxtfile, press Enter, under normal circumstances, we can get the results of the command is: txtfile = "% SystemRoot% system32NOTEPAD.EXE"% 1, the results show: File Types The txtfile is associated with the open command txtfile="%SystemRoot%system32NOTEPAD.EXE"%1.
If the association between a file type with an open command there is a problem, and we know what the right order is open, then we only need to enter the following command in cmd and press Enter repair: ftypefileType = openCommandString, where fileType represents the specified file types, such as txtfile, here openCommandString represents the open command, such as if the association between our txtfile and open command notepad.exe
Something went wrong, we just need to type in the cmd: ftypetxtfile="%SystemRoot%system32NOTEPAD.EXE"%1, press the Enter key, so we also fix the association between the txtfile file type and its open command. .
so-called open-command, in fact, for this type of file Open. For each registered file type, there will be a corresponding registry entry in the registry. This registry key is: HKEY_CLASSES_ROOTfiletype, this filetype represents the file type, such as the registry corresponding to the batfile file type. The item is: HKEY_CLASSES_ROOT?atfile, the registry key modified by the ftype command is mainly --- HKEY_CLASSES_ROOTfiletypeshellopencommand---the default value of this item.
But note that, ftype command to modify the data and not just the default values. Therefore, modifying this data directly in the registry does not replace the modification of the ftype command.
course, ftype command to modify all things can be found in the registry, but we did find one by one, far better to use a simple command to modify ftype is more cool.
right in front of open
the way we talked about the extension associated with the file type, file type association with the Open command (ie file is opened), it looks as if we are about The problem of file association is finished, but it is not. There is another important aspect that we have not mentioned. This is where we right click on a file and select the open method (not all files have the option to open the right button), then we select a program and check the box before "Always use this program to open the same type of file" , click to confirm. For example, the friend at the beginning of this article has chosen to open all shortcuts in the Word program. This way, this file type is also associated with this open command.
ftype command is to modify file type associations with the open command, and open the right way you can modify the file type association with open-ended command, and what the relationship between these two is it?
we found, ftype command and open the right way, both the modified registry key is different. The registry key modified by the Ftype command is: HKEY_CLASSES_ROOTfiletype, this filetype represents the file type, such as HKEY_CLASSES_ROOTlnkfile, and the main registry key modified by the right-click open mode is: HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerFileExts.ext, this .ext represents the file extension. For example: HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerFileExts.lnk, as I understand, the content modified by the ftype command belongs to the system settings, and the content modified by the right-click open mode belongs to the user settings. The actual objects set by the two are the same, when the two are inconsistent User settings take precedence over system settings.
three registry entries
In short, file associations involved are the three main registry key:
HKEY_CLASSES_ROOT.ext
HKEY_CLASSES_ROOTfiletype < BR>
HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerFileExts.ext
problem solving
now go back to what we call at the beginning of the problem. I taught that friend to enter: assoc.lnk, the result of the returned command is: .lnk=lnkfile, which indicates that there is no problem with the association between the extension .lnk and the file type lnkfile. I want him to type: ftypelnkfile, the result of the returned command is: the file type "lnkfile" or its associated open command was not found, and the result is normal, which indicates that between the lnkfile and the open command in the system settings. There is no problem with the association. The association between lnkfile and open command
So, the problem only lies in the user settings there is a problem. Under normal circumstances, the setting of the right-click mode takes precedence over the setting of the file association by the ftype command. This is the same for both xp and win7, but for shortcuts with a .lnk extension, the two are different. In Win7, even for .lnk shortcuts, the setting of the right-click mode takes precedence over the setting of the ftype command.
found the problem, we can know, for file association errors this shortcut, we use the assoc command and ftype are unable to solve. The solution is:
delete the following registry entry in the registry right: values and data at HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerFileExts.lnkUserChoice this registry key (the specific value is called progid and its data), is Corresponding to the default open program set by the right-click open mode.
After deleting, restart the computer, or restart the explorer, the problem perfectly resolved. In addition to this solution, other solutions have not been found yet.
By the way, in XP, UserChoice this registry entry is not.
due to some file right way option is not open in xp, we can see the folder options --- ---- file types inside my computer tools ---- point, where we can be The same settings, and under Win7, we can in the ----- control panel --- program --- default program --- always use the specified program to open this text type --- inside to set, xp set The options are much more, and the settings under Win7 are extremely concise.