How To Register A File Type

Table of contents:

How To Register A File Type
How To Register A File Type

Video: How To Register A File Type

Video: How To Register A File Type
Video: CSE260 Register Files 2024, May
Anonim

As a rule, when you double-click on a file or select the "Open" command of the standard Windows shell context menu, an application is automatically launched that can display or edit the selected document. Information about the correspondence of file extensions to their types, and types to programs, is stored in the operating system registry. Typically, this information is entered into the registry when programs are installed. If this does not happen, you can register the file type manually.

How to register a file type
How to register a file type

Necessary

the right to change the register

Instructions

Step 1

Start the Registry Editor application. Click on the "Start" button located in the taskbar on the desktop. In the menu that appears, select the "Run" item. The "Run Program" dialog will open. In the Open text box, enter redegit. Click OK.

How to register a file type
How to register a file type

Step 2

Register the file extension and match it with a symbolic type identifier. In the left pane of Registry Editor, select the root key named HKEY_CLASSES_ROOT. Create a key in it with a name corresponding to the file extension of the registered type. To do this, right-click on the section name or open the "Edit" menu. Then select the "Create" and "Section" items. Type an extension including a period (for example,.myapp) and press Enter.

In the left pane, select the newly created section. In the right pane, double-click on the item named "(Default)". In the dialog box that appears, enter the identifier of the file type to be registered. It can be anything, but it must be unique. It makes sense to give simple and memorable names to file types.

How to register a file type
How to register a file type

Step 3

Register the file type. In the HKEY_CLASSES_ROOT section, create a key with a name that matches the type name entered in the second step. To create a registry key, follow the steps described earlier. As the default parameter of the created section, enter a short description characterizing the information that is stored in files of the registered type.

How to register a file type
How to register a file type

Step 4

Assign an icon to files of the registered type. Create a key named DefaultIcon in the section added in the third step. For the default value of this key, enter the path to the icon file, executable module, or dynamic library. In the last two cases, after the file name, separated by commas, you can specify the identifier of the image resource contained in the module.

How to register a file type
How to register a file type

Step 5

Determine the application that opens files of the registered type. Add a key named shell to the file type section. Add a key named open to the shell section. Next, add the command key to open. Thus, a branch like HKEY_CLASSES_ROOT / filename / shell / open / command should be created in the registry.

Change the default value of the command key by entering the command to launch an application that can open files of the registered type. Use the% 1 placeholder to specify where to substitute the name of the file to open on the command line.

How to register a file type
How to register a file type

Step 6

Define an application editing files of the registered type. Follow the steps described in the previous step to create the HKEY_CLASSES_ROOT / filetype_name / shell / edit / command. For the default value of the command key, enter the file edit command. The% 1 placeholder can also be used.

Recommended: