IT tutorials
 
Windows
 

Windows Vista : Mastering File Types - Understanding File Types

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
11/28/2012 11:03:05 AM
File Types and File Extensions

One of the fictions that Microsoft has tried to foist on the computer-using public is that we live in a “document-centric” world. That is, that people care only about the documents they create and not about the applications they use to create those documents. This is pure hokum. The reality is that applications are still too difficult to use and the capability to share documents between applications is still too problematic. In other words, you can’t create documents unless you learn the ins and outs of an application, and you can’t share documents with others unless you use compatible applications.

Unfortunately, we’re stuck with Microsoft’s worship of the document and all the problems that this worship creates. A good example is the hiding of file extensions.  Here are just a few of the problems this allegedly document-centric decision creates:

Document confusionIf you have a folder with multiple documents that use the same primary name, it’s often difficult to tell which file is which. For example, Figure 4.1 shows a folder with 18 different files named Project. Windows Vista unrealistically expects users to tell files apart just by examining their icons. To make matters worse, if the file is an image, Vista shows a thumbnail of the image instead of an icon. The result is that in Figure 1 it’s impossible to tell at a glance which image is a GIF, which is a JPEG, and so on.

Figure 1. With file extensions turned off, it’s often difficult to tell one file from another.

The inability to rename extensionsIf you have a file named index.txt and you want to rename it to index.html, you can’t do it with file extensions turned off. If you try, you just end up with a file named index.html.txt.
The inability to save a documentSimilarly, with file extensions turned off, Windows
under an extension of your choiceVista forces you to save a file using the default extension associated with an application. For example, if you’re working in Notepad, every file you save must have a txt extension. If you create your own web pages, for example, you can’t rename these text files with typical web page extensions such as .htm, .html, .asp, and so on.

Tip

There is a way to get around the inability to save a document under an extension of your choice. In the Save As dialog box, use the Save as Type list to select the All Files option, if it exists. You can then use the File Name text box to type the filename with the extension you prefer to use.


You can overcome all these problems by turning on file extensions. Why does the lack of file extensions cause such a fuss? Because file extensions solely and completely determine the file type of a document. In other words, if Windows Vista sees that a file has a .txt extension, it concludes the file uses the Text Document file type. Similarly, a file with the extension .bmp uses the Bitmap Image file type.

Note

As a reminder, you turn on file extensions by selecting Windows Explorer’s Organize, Folder Options command, displaying the View tab, and deactivating the Hide File Extensions for Known File Types check box.


The file type, in turn, determines the application that’s associated with the extension. If a file has a .txt extension, Windows Vista associates that extension with Notepad, so the file will always open in Notepad. Nothing else inherent in the file determines the file type so, at least from the point of view of the user, the entire Windows Vista file system rests on the shoulders of the humble file extension.

This method of determining file types is, no doubt, a poor design decision. For example, there is some danger that a novice user could render a file useless by imprudently renaming its extension. Interestingly, Microsoft seems to have recognized this danger and programmed a subtle behavior change into Vista: When file extensions are turned on and you activate the Rename command (click the file and then press F2), Vista displays the usual text box around the entire filename, but it selects only the file’s primary name (the part to the left of the dot), as shown in Figure 2. Pressing any character obliterates the primary name, but leaves the extension intact.

Figure 2. When you activate the Rename command with file extensions turned on, Windows Vista selects just the file’s primary name.

Despite the drawbacks that come with file extensions, they lead to some powerful methods for manipulating and controlling the Windows Vista file system.

File Types and the Registry

As you might expect, everything Windows Vista knows about file types is defined in the Registry. Open the Registry Editor (press Windows Logo+R—or select Start, All Programs, Accessories, run—type regedit, click OK, and enter your credentials) and examine the HKEY_CLASSES_ROOT key. Notice that it’s divided into two sections:

  • The first part of HKEY_CLASSES_ROOT consists of dozens of file extension subkeys (such as .bmp and .txt). There are well over 400 such subkeys in a basic Windows Vista installation, and there could easily be two or three times that number on a system with many applications installed.

  • The second part of HKEY_CLASSES_ROOT lists the various file types that are associated with the registered extensions. When an extension is associated with a particular file type, the extension is said to be registered with Windows Vista.

Note

HKEY_CLASSES_ROOT also stores information on ActiveX controls in its CLSID subkey. Many of these controls also have corresponding subkeys in the second half of HKEY_CLASSES_ROOT.


To see what this all means, take a look at Figure 3. Here, I’ve selected the .txt key, which has txtfile as its Default value.

Figure 3. The first part of the HKEY_CLASSES_ROOT key contains subkeys for all the registered file extensions.

That Default value is a pointer to the extension’s associated file type subkey in the second half of HKEY_CLASSES_ROOT.Figure 4 shows the txtfile subkey associated with the .txt extension. Here are some notes about this file type subkey:

  • The Default value is a description of the file type (Text Document, in this case).

  • The DefaultIcon subkey defines the icon that’s displayed with any file that uses this type.

  • The shell subkey determines the actions that can be performed with this file type. These actions vary depending on the file type, but Open and Print are common. The Open action determines the application that’s associated with the file type. For example, theOpen action for a Text Document file type is the following:

Figure 4. The second part of HKEY_CLASSES_ROOT contains the file type data associated with each extension.

%SystemRoot%\system32\NOTEPAD.EXE %1

Note

The %1 at the end of the command is a placeholder that refers to the document being opened (if any). If you double-click a file named memo.txt, for example, the %1 placeholder is replaced by memo.txt, which tells Windows to run Notepad and open that file.

 
Others
 
- Windows Server : Planning for Data Sharing and Collaboration (part 2) - DFS Replication Advanced Settings and Features, Planning a SharePoint Infrastructure
- Windows Server : Planning for Data Sharing and Collaboration (part 1) - Planning a DFS Deployment, DFS Namespaces Advanced Settings and Features
- Exploring Windows 8 Apps : Working with Apps (part 2) - Displaying the Apps Panel,Tiling Apps
- Exploring Windows 8 Apps : Working with Apps (part 1) - Exploring a Program “Window”, Checking Out a Metro App
- Exploring Windows 8 Apps : Finding and Starting Apps
- Windows 7 : Running Programs and Gadgets - Composing a Document
- Windows 7 : Running Programs and Gadgets - Using the Ribbon
- Exploring Windows 8 Apps : Getting Started with Apps (part 2) - Pinning Apps to the Start Menu, Creating App Groups
- Exploring Windows 8 Apps : Getting Started with Apps (part 1) - Reviewing Apps
- Windows Home Server 2011 : Using a Mac on Your Windows Home Server Network (part 3)
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us