Windows data file types

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.

  1. 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

  1. 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

  1. Now navigate to the file for which you want to change the file format. Right-click on it and select Rename.
  2. 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.

Windows Data Types for Strings

Most string operations can use the same logic for Unicode and for Windows code pages. The only difference is that the basic unit of operation is a 16-bit character (also known as a wide character) for Unicode and an 8-bit character for Windows code pages. The Windows header files provide several type definitions that make it easy to create sources that can be compiled for Unicode or for Windows code pages.

Windows supports three sets of character and string data types: a set of generic type definitions that can compile for either Unicode or Windows code pages, and two sets of specific type definitions. One set of specific type definitions is for use with Unicode, and the other is for use with Windows code pages.

An application using generic data types can be compiled for Unicode simply by defining «UNICODE» before the #include statements for the header files, or during compilation. New Windows applications should use Unicode to avoid the inconsistencies of varied code pages and to simplify localization. They should be written with generic data types, and should define «UNICODE» in order to compile these types into Unicode types. In the few places where an application must work with 8-bit character data, it can make explicit use of the types for Windows code pages.

The ability to compile the generic types into types for Windows code pages exists mainly to support legacy applications. To compile for Windows code pages, the application just omits the UNICODE definition.

Читайте также:  Что делать если windows 10 зависает при обновлении

The following example shows the method used in the Windows header files to define the three sets of data types. For the implementation, see the Winnt.h header file.

The letter «T» in a type definition, for example, TCHAR or LPTSTR, designates a generic type that can be compiled for either Windows code pages or Unicode. The letter «W» in a type definition, for example, WCHAR or LPWSTR, designates a Unicode type. Because Windows code pages are of the older form, they have simple type definitions, such as CHAR and LPSTR. For a complete description of data types in Windows, see Windows Data Types.

File Types and File Associations

This section on file types and file associations is organized as follows:

Additional Resources

  • Set Program Access and Computer Defaults (SPAD) is a Windows Control Panel which allows users with administrative privilege to set a machine default and hide or show an application. Media, Mail, Browser, Messenger and Java applications are examples of applications registered in SPAD. Set Your Default Programs (SYDP) is a Windows Control Panel, that works with limited privileges, and permits users to set a user default. Any application can register in SYDP. For information about SPAD and SYDP application registration, see Guidelines for File Associations and Default Programs, and Set Program Access and Computer Defaults (SPAD).
  • For related conceptual background, see Overview of Verbs and File Associations.
  • To create a Shell data store, see Implementing the Basic Folder Object Interfaces.

For related reference documentation, see the following topics:

  • To execute a verb on a Shell item, see the InvokeVerb method.
  • To retrieve a collection of verbs that can be executed on a Shell item, see the Verbs method.
  • For performing an operation on a specified file, see either the ShellExecute or ShellExecuteEx functions.
  • For a list of default perceived types, see the PERCEIVED enumeration.
  • To retrieves a file’s perceived type based on its extension, see the AssocGetPerceivedType function.

Идентификация типов файлов, файлов и папок Identify File Types, Files, and Folders

При планировании миграции , если не MigDocs.xml, необходимо определить типы файлов, файлы, папки и параметры, которые необходимо перенести. When planning for your migration, if not using MigDocs.xml, you should identify the file types, files, folders, and settings that you want to migrate. Сначала необходимо определить стандартные расположения файлов на каждом компьютере, например «Мои документы». First, you should determine the standard file locations on each computer, such as My Documents. , C:\Data и указанные компанией расположения, такие как \EngineeringDrafts. , C:\Data , and company-specified locations, such as \EngineeringDrafts. Затем необходимо определить и найти нестандартные расположения. Next, you should determine and locate the non-standard locations. Для нестандартных местоположений рассмотрите следующие вопросы: For non-standard locations, consider the following:

Типы файлов. File types. Подумайте, какие типы файлов необходимо включить и исключить из миграции. Consider which file types need to be included and excluded from the migration. Этот список можно создать на основе распространенных приложений, используемых в организации. You can create this list based on common applications used in your organization. Приложения обычно используют определенные расширения имен файлов. Applications normally use specific file name extensions. Например, MicrosoftOffice Word в основном использует расширение DOC, DOCX и DOTX. For example, MicrosoftOffice Word primarily uses .doc, .docx and .dotx file name extension. Однако он также использует другие типы файлов, например шаблоны (DOT-файлы), реже. However, it also uses other file types, such as templates (.dot files), on a less frequent basis.

Исключенные расположения. Excluded locations. Рассмотрите расположения на компьютере, которые следует исключить из миграции (например, %WINDIR% и Program Files). Consider the locations on the computer that should be excluded from the migration (for example, %WINDIR% and Program Files).

Новые расположения. New locations. Определите, куда следует перенести файлы на компьютер назначения, например \My Documents, назначенную папку или папку, которая соответствует имени и расположению файлов на компьютере источника. Decide where files should be migrated to on the destination computer for example, \My Documents, a designated folder, or a folder matching the files’ name and location on the source computer. Например, у вас могут быть общие данные на компьютере-источнике или вы можете очистить документы за пределами профилей пользователей в этой системе. For example, you might have shared data on source machine or you might wish to clean up documents outside the user profiles on the source system. Определите все данные, которые должны быть перенаправлены в новое расположение на этапе применения. Identify any data that needs to be redirected to a new location in the apply phase. Это можно сделать с помощью правил изменения расположения. This can be accomplished with location modify rules.

Читайте также:  Windows с разделами hfs

После проверки типов файлов и файлов, с которыми пользователи регулярно работают, необходимо найти их. Once you have verified which files and file types that the end users work with regularly, you will need to locate them. Файлы могут быть сохранены в одной папке или на диске. Files may be saved to a single folder or scattered across a drive. Отправной точкой для поиска типов файлов, которые необходимо включить, является просмотр зарегистрированных типов файлов на компьютере. A good starting point for finding files types to include is to look at the registered file types on the computer.

Поиск зарегистрированных типов файлов на компьютере под управлением Windows7 или Windows8 To find the registered file types on a computer running Windows7 or Windows8

Нажмите Начать. Click Start. Откройте панель управления, щелкните «Домашняя панельуправления» и выберите «Программы». Open Control Panel, click Control Panel Home, and click Programs.

Щелкните «Программы по умолчанию» и выберите «Связать тип файла или протокол с программой». Click Default Programs, and click Associate a file type or protocol with a program.

На этом экране отображаются зарегистрированные типы файлов. On this screen, the registered file types are displayed.

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.

Читайте также:  Как установить openssh для windows

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.

Оцените статью