Windows File Association and open method list-modify registry strategy and file association registry strategy

Source: Internet
Author: User

Windows File Association and open method list-modify registry strategy and file association registry strategy

Here are all ways to modify the registry. After searching for the Internet for half a day, some of them only have the method to add file associations, but they have not been added to the open method list. Some have the method to add files to the file list, it is used with the control panel-> folder option. It is difficult to find all. from adding a file association to deleting a file association, You can manually modify the Registry. This method is applicable to programming registry operations.

 

Add File Association: (demonstrate adding a file association in *. lfw format)

Add ". lfw" to the HKEY_CLASSES_ROOT key"

 

 

Set the default value of ". lfw" to "lfwfile" (the name can be any one)

 

 

 

 

 

Add "lfwfile" under HKEY_CLASSES_ROOT"

Add "DefaultIcon" and "shell" to the new "lfwfile"

 

Create item "open" under item "shell" and "command" under item "open"

The default value of ulticon is the icon path. Here is the icon of the file with the extension *. lfw:

Icon path:

 

 

The default value of "command" is the program path.

Program path:

Add "" % 1 "" after the path to open the double-click. lfw file.

 

 

 

Test results:

Create Text Document

 

Change the extension to. lfw.

Press enter. The system will prompt you to press OK. The icon is changed to the following:

Double-click it to open it. Use the program "E:/Li fengwei/vc/RichEditView/Debug/lfw.exe" to open it.

This is an example mini-program made by MFC, which is very similar to text documents, but not text documents.

Sample Applet:

Text Document:

 

Right-click the file, select "properties", and select "change" to open the file. The newly added file type appears in the open mode, I don't know why ).

 

Delete file association type:

First, delete the two keys.

/HKEY_CLASSES_ROOT/. lfw
/HKEY_CLASSES_ROOT/lfwfile

 

In this way, the file association is basically deleted, but this type still exists in the open mode list. Then, delete the following key.

/HKEY_CLASSES_ROOT/Applications/lfw.exe

 

Lfw.exe is the name of the associated application. In this way, it is not the type in the Open Method list. However, the icon of this type of file remains unchanged. When I open the computer the next day, the icon Association disappears. I don't know if it will be removed after I restart the computer.

 

But there are several other keys with residual records, the following six keys

==/ HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Explorer/FileExts/. lfw

==/ HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Explorer/RecentDocs/. lfw
/HKEY_CURRENT_USER/Software/Microsoft/Windows/ShellNoRoam/MUICache

 

**/HKEY_USERS/S-1-5-21-583907252-1383384898-725345543-1003/Software/Microsoft/Windows/CurrentVersion/Explorer/FileExts/. lfw
**/HKEY_USERS/S-1-5-21-583907252-1383384898-725345543-1003/Software/Microsoft/Windows/CurrentVersion/Explorer/RecentDocs/. lfw
/HKEY_USERS/S-1-5-21-583907252-1383384898-725345543-1003/Software/Microsoft/Windows/ShellNoRoam/MUICache

 

 

When two keys marked with ** are deleted, the two keys marked with = are automatically deleted. These four keys are the opening records for this type of file, files of this type are recorded. In fact, these two keys are not required. The last key MUICache does not know what it is for. I hope some people will give you some advice.

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.