- How to Change File Type in Windows 10
- Showing file extensions and changing the file format
- File Types
- Public and Private File Types
- Registering a File Type
- Setting Optional Subkeys and File Type Extension Attributes
- Deleting Registry Information During Uninstallation
- File Types That Support Open Metadata
- read known file extensions / types from the registry
- 4 Answers 4
- How to show File Extensions in Windows 10
- What are File Extensions & how are they useful
- Show File Extensions in Windows 10
- 1] Through Folder or File Explorer Options
- 2] Via Windows File Explorer
- 3] Using the Registry Editor
How to Change File Type in Windows 10
With our increasing use of computers in our daily life, it may get necessary even for a simple user to change the file type of a file from one format to another. Each file format has their own properties. For example a ‘.txt’ file will probably get opened by the text editor while an ‘html’ file will get launched in your default browser.
File format analogy
Even though the contents inside the files might be the same, the file type matters a lot. The process of changing file type is quite simple and straightforward. However, there are some cases whereby changing the file type, the file becomes unusable. Hence it is recommended that you know exactly what you’re doing and also make an additional copy of the file.
Showing file extensions and changing the file format
By default, Windows doesn’t have the file format displayed alongside every file. For example, if a file is a text file, its name wouldn’t display ‘ap puals.txt’. Instead, it will only display ‘appuals’. First, we will enable the file extensions and then through basic rename, we will change the file extension. You can also choose to rename files in bulk if there are a lot of files that you need to change the type for.
- Press Windows + E, click View from the top-most ribbon. Now click Options and select the option Change folder and search options.
Change folder and search options – Windows Explorer
- Now uncheck the option Hide extensions for known file types. Now all the files will have their file extensions displayed alongside their names.
Enabling File Extensions – Windows Explorer
- Now navigate to the file for which you want to change the file format. Right-click on it and select Rename.
- Now change the file’s extension to the extension of the type which you want to change into. In this example, we change a ‘text’ file to a ‘python’ file. The extensions for a text file are ‘txt’ and for python ‘py’.
Process of changing a file type
Here is a list of common file extensions used in the world of computing. We have listed them according to their type.
File Types
This topic explains how to create new file types and how to associate your app with your file type and other well-defined file types. Files with a shared common file name extension (.doc, .html, and so on) are of the same type. For example, if you create a new text editor, then you can use the existing .txt file type. In other cases, you might need to create a new file type.
This topic is organized as follows:
Additional information can be found on the following topics:
Public and Private File Types
Public file types are also known as popular or contentious types because competing applications might want to be associated with these file types. Characteristics of public file types include:
- They are typically defined by standards bodies, and/or are promoted by their defining organizations as interchange formats.
- They are often exchanged between computers and users for diverse purposes.
- They need to be supported on many different platforms.
- Applications from multiple vendors are likely to handle them.
Some examples of file types that are considered public are the image file types .png, .gif, .jpg, and .bmp, and the audio types .wav, .mp3, and .au.
Unlike public file types, private or proprietary file types typically have a format that is implemented and understood by only one application or vendor. As a result, private file types are typically not prone to conflicts between applications. Some file types can start as private file types but later become public file types.
Windows does not differentiate between public and private file types. The distinction is relevant only in making decisions about your choice of file type registration.
Registering a File Type
To associate the file type with an existing application, locate the application ProgID in the registry. To associate the file type with a new application, define a ProgID for your application. For information about defining a new ProgID, see Programmatic Identifiers.
File name extension subkeys have the following general form: extension=ProgID. File name extension subkeys are stored in the HKEY_CLASSES_ROOT subtree.
It is important to include the leading period (.) when creating file type subkeys in the registry. For example, if you want a file type with the short extension .myp and the long extension .myp-file to be opened with an application called MyProgram, use the following syntax:
As demonstrated in the preceding example, if you also register a short file name extension (.myp), you should create a subkey for the long extension (.myp-file) as well. For more information, see File Type Handlers.
Setting Optional Subkeys and File Type Extension Attributes
File type extension entries in the registry have several optional subkeys and attributes.
The file type extension entries that are used by file associations are described in the following table. All values are of the REG_SZ type.
Registry entry | Action |
---|---|
Default | Set the default value of the extension subkey to the ProgID to which it is linked. |
Content Type | Set the Content Type value to the file type’s MIME content type. |
OpenWithList | Do not use. This subkey contains one or more application subkeys for applications that appear in the Open with dialog box entry for the file type and is intended only for .exe applications on operating systems prior to WindowsВ XP. Use OpenWithProgIds instead. |
OpenWithProgIds | This subkey contains a list of alternate ProgIDs for this file type. The programs for these ProgIDs appear in the Open with menu and are available as default Windows Store apps for the file type. Whenever an application takes over this file type by changing the default value, it should also add an entry to this list. |
PerceivedType | Set the PerceivedType value to the PerceivedType to which the file belongs, if any. This string is not used by Windows versions prior to WindowsВ Vista. For more information, see Perceived Types and Application Registration. |
The general form of a file name extension subkey is as follows. All entry types are of the REG_SZ type.
Important considerations about file types include:
The HKEY_CLASSES_ROOT subtree is a view formed by merging HKEY_CURRENT_USER\Software\Classes and HKEY_LOCAL_MACHINE\Software\Classes
In general, HKEY_CLASSES_ROOT is intended to be read from but not written to. For more information, see the HKEY_CLASSES_ROOT article.
To register a file type globally on a particular computer, create an entry for the file type in the HKEY_LOCAL_MACHINE\Software\Classes subkey.
To make a file type registration visible to the current user only, create an entry for the file type in the HKEY_CURRENT_USER\Software\Classes subkey.
An application can provide its own implementation of a verb, such as open or play, as shown in the following registry example.
Subkeys of the verb subkey include the command line and the drop target method: command and DropTarget.
When you create or change a file association, it is important to notify the system that you have made a change. Do so by calling SHChangeNotify and specifying the SHCNE_ASSOCCHANGED event. If you do not call SHChangeNotify, the change may not be recognized until after the system is rebooted.
To retrieve registry information regarding a file association, use the IQueryAssociations interface. For a scenario that illustrates this procedure, see File Association Sample Scenario.
Both the App Paths and Applications registry subkeys are used to register and control the behavior of the system on behalf of applications. For more detailed information about this functionality, see Application Registration.
Deleting Registry Information During Uninstallation
When uninstalling an application, the ProgIDs and most other registry information associated with that application should be deleted as part of the uninstallation. However, applications that have taken ownership of a file type (by setting the Default value of the file type’s HKEY_CLASSES_ROOT\.extension subkey to the ProgID of the application) should not attempt to remove that value when uninstalling. Leaving the data in place for the Default value avoids the difficulty of determining whether another application has taken ownership of the file type and overwritten the Default value after the original application was installed. Windows respects the Default value only if the ProgID found there is a registered ProgID. If the ProgID is unregistered, it is ignored.
Note that other file-type ownership information is stored in the HKEY_CURRENT_USERsubtree and also is used only when the application that it references is registered. Therefore, this data does not need to be removed when uninstalling an application.
As an example, the following shows the state of the registry before an application is uninstalled:
The following shows the state of those same registry entries after the application has been uninstalled.
File Types That Support Open Metadata
In WindowsВ 7 and later, the following file types support open metadata.
read known file extensions / types from the registry
I want to present the user with a list of known file extensions for him to pick. I know that these are stored in the Registry under HKEY_CLASSES_ROOT usually like this:
where txtfile then contains the information about associated programs etc.
Unfortunately that place in the registry also stores lots of other keys, like the file types (e.g. txtfile) and entries like
CAPICOM.Certificates (whatever that is)
How do I determine which of the entries are file extensions? Or is there a different way to get these extensions like an API function?
(I don’t think it matters, but I am using Delphi for the program.)
4 Answers 4
There is no guarantee that every keys preceded by a dot in HKEY_CLASSES_ROOT is intended for file association, but every file association requires creation of a key preceded by a dot. See MSDN on File Types topic.
AFAIK, the method I describe here conforms with how the Windows Set File Associations feature works to get a list of all known file types. It was based on my former observation when I delved into this subject.
To achieve that, you’ll need to do intricate steps as follows:
Enumerating every keys preceded by a dot . , you can use RegQueryInfoKey() and RegEnumKeyEx() for this purpose.
In every keys preceded by a dot, look at the default value data:
a. If the default value is not empty, this is enough indication that the «preceding dot key» is intended for file association in all Windows NT version, then try to open the key name as mentioned by the value data, just says TheKeyNameMentioned.
a1) If there is subkeys shell\open\command under TheKeyNameMentioned, then test the existence of the path pointed by the default value of this key; if the path exists, there is a default application associated with the extension; if the path doesn’t exists, the default application is unknown. To get the file extension description, look at the default value of TheKeyNameMentioned. To get the program description, first, test whether the following key contain a value-name equal to the EXE file path, that is HKCR\Local Settings\Software\Microsoft\Windows\Shell\MuiCache . If it is there, then look at the value data to get the file description; if it is not there, use GetFileVersionInfo() directly to get the file description.
a2) If there is no subkeys shell\open\command under TheKeyNameMentioned, then the default application is unknown. To get the file extension description, look at the default value of TheKeyNameMentioned.
b. On Windows Vista and later, when the point [a] fails, you need additional check. If the default value is empty, test whether the key has a subkey named OpenWithProgIDs .
If OpenWithProgIDs subkey exists, use RegEnumValue() to find the first encountered value name that meets the criteria, that is, the name of the value name must point to an existing key (just says TheKeyNameMentioned.) with the same name as the value name. If TheKeyNameMentioned exists, this is enough indication that the «preceding dot key» is intended for file association. Read point a1 and a2 for the next steps.
If OpenWithProgIDs subkey doesn’t exist, the default application is unknown. To get the file extension description, look at the default value of TheKeyNameMentioned.
How to show File Extensions in Windows 10
File Extension is that which identifies the file type. If you are a regular Windows user, then it is not at all a problem to identify the file type. For it is very important to see file extension to identify the type of file you are trying to open from a security point of view. So in this post, we will see how to hide or show File Extensions in Windows 10/8/7 and why you should show them.
Since file names allow you to use multiple full stops, the real name of a malware file could be realword .docx.exe . But because you have not set Windows to show file extensions, you would see only realword .docx . Thinking its a Word document, you could well end up clicking on it and infecting your computer. If you had, on the other hand, set your PC to show file extensions, you would see its full name – realword .docx.exe , which would help you to identify that it was actually an executable file and in all probability a malware file.
What are File Extensions & how are they useful
Different file types have different extensions. Audio files have .mp3, .wav, .wma, and more based on the program used to open that file. File extensions also help the operating system to identify the corresponding program to open that particular file. So, you should be able to see file extensions to be at the safer side, and we will let you know how to enable options to see file extensions in Windows.
As mentioned earlier, by default Windows does not show file extensions and they are hidden. But, you can toggle the option to see them.
Show File Extensions in Windows 10
There are five ways how you can go about accessing this setting:
- Through the File Explorer Options
- Through Windows Explorer Ribbon
- Using the Registry
- Using Command Prompt
- Using Group Policy Editor.
1] Through Folder or File Explorer Options
Open Control Panel > Appearance and Personalization. Now, click on Folder Options or File Explorer Option, as it is now called > View tab.
In this tab, under Advanced Settings, you will see the option Hide extensions for known file types. Uncheck this option and click on Apply and OK.
Windows 10 users may also search for File Explorer Options in Start search box and open this box.
Now, you can see file extensions for all files anywhere on your Windows system.
In Windows 10/8.1 Explorer, you can access File Explorer Options via Explorer.
Click View > Options > Change folder and search options.
Once here, you can do the needful as explained above.
In Windows 7, open Explorer, press Alt on your keyboard to make the Classic bar appear. Next, click on Tools > Folder Options. Now follow the steps mentioned above.
These are very simple steps to follow, and you do not need any third-party software to view file extensions. Windows provides us with everything which can be easily achieved, and the point lies in knowing and implementing them. This is the first way to see file extensions in Windows 7.
2] Via Windows File Explorer
Open Explorer and click on the View tab. Simply select the File name extensions checkbox, and you are all set.
3] Using the Registry Editor
Hit the WINKEY + R button combination to launch the Run utility, type in regedit and hit Enter. Once Registry Editor opens, navigate to the following key-
Look up for a DWORD entry labeled as HideFileExt.
Double click on the mentioned DWORD entry and set its value as 0. This will show up the hidden file extensions.
A value of 0 will hide the file extensions.
Exit the Registry Editor and then reboot your computer for the changes to take effect.
4] Use Windows Command Prompt
This fix can be used in both the scenarios mentioned above. Insert a bootable drive of Windows 10 installer.
Start by hitting the WINKEY + X combinations and select Command Prompt (Admin) to launch Command Prompt with Administrator Privileges.
Navigate to the root location of that bootable device inside the Command Prompt command line. Once you get there, type in the following to show the file extensions-
And then hit Enter.
You can also enter the following command to hide the file extensions,
5] Using Group Policy Editor
You can also use the Group Policy Editor and change the setting here:
User Configuration > Preferences > Control Panel Settings > Folder Options.
Set “Show hidden files and folders” and uncheck “Hide extensions for known file types”.
Thus, you can set your Windows to show file extensions in Windows 10/8. If you have anything to add, please do share it with us through comments.
Date: March 22, 2020 Tags: Explorer, Features