Section 2.7. Files, Folders, and Disks

Files are the basic unit of long-term storage on a computer. Files are organized into folders, which are stored on disks. (In DOS, Unix, and earlier versions of Windows, folders were more often referred to as directories, but both terms are still used.) This section reviews fundamental filesystem concepts, including file-and disk-naming conventions and file types.

2.7.1. Disk Names

Like every version of Windows that preceded it, Windows Vista retains the basic DOS disk-naming conventions. Drives are differentiated by a single letter of the alphabet followed by a colon:


Represents the first "floppy" (usually 3.5-inch) disk drive on the system


Represents the second floppy disk drive, if present


Represents the first hard disk drive or the first partition of the first hard disk drive


Often represents a DVD-ROM or CD-ROM drive, but can represent an additional hard disk drive or other removable drive

E: through Z:

Represent additional hard disk drives, DVD-ROM or CD-ROM drives, Universal Serial Bus (USB) flash drives, removable cartridges such as ZIP or Jaz drives, or mapped network drives

By default, drive letters are assigned consecutively, but it's possible to change the drive letters for most drives so that you can have a drive N: without having a drive M:. (See Chapter 4 for details.)

2.7.2. Pathnames

Folders, which contain files, are stored hierarchically on a disk and can be nested to any arbitrary level.

The filesystem on any disk begins with the root (top-level) directory, represented as a backslash. Thus, C:\ represents the root directory on the C: drive. Each additional nested directory is simply listed after its "parent," with backslashes used to separate each one. C:\Windows\System\Color means that the Color folder is in the System folder in the Windows folder on the C: drive. Thus, you can express a path to any given folder as a single string of folder names.

A path can be absolute (always starting with a drive letter) or relative (referenced with respect to the current directory). The concept of a current directory is somewhat obsolete in Windows Vista, as it was in Windows NT, Windows 2000, and Windows XP, with the exception of commands issued from the command prompt. Each Command Prompt window has an active folder associated with it, to which each command is directed. For example, if the current directory is C:\windows, and you type DIR (the directory listing command), you would get a listing of the files in that folder. If you then type CD cursors, the current directory would become C:\windows\cursors.

The fact that the entire absolute path was not needed after the CD command is an example of the use of a relative path.

A special type of relative path is made up of one or more dots. The names . and .. refer to the current directory and the parent of that directory, respectively (C:\windows is the parent folder of C:\windows\cursors, for example). Type CD .. while in C:\windows, and the current directory becomes simply C:\. Use of additional dots (such as ...) in some previous versions of Windows is not supported in Windows XP or Vista. The graphical equivalent of .. is the yellow folder icon with the curved arrow, found in common file dialogs.

The left pane (Navigation Pane) in Windows Explorer (by default) contains a hierarchical tree-structured view of the filesystem. The tree structure makes it easier to navigate through all the folders on your system because it provides a graphical overview of the structure. See Chapter 3 for more information on the tree and Chapter 4 for more information on the Windows Explorer application.

2.7.3. Paths to Network Resources

You can refer to files on any shared network via a Universal Naming Convention (UNC) pathname, which is very similar to a path (described in the preceding section). The first element of a UNC pathname is the name of the computer or device that contains the file, prefixed by a double backslash. The second element is the device's share name. What follows is the string of folders leading to the target folder or file.

For example, the UNC path \\shoebox\o\hemp\adriana.txt refers to a file named adriana.txt, located in the hemp folder, located on drive O:, located on a computer named shoebox.

For more information on UNC pathnames and sharing resources on a network, see Chapter 7.

2.7.4. Short Names and Long Names

DOS and Windows 3.1, the Microsoft operating systems that preceded Windows 95 and Windows NT, only supported filenames with a maximum of eight characters, plus a three-character file type extension (e.g., myfile.txt). The maximum length of any path was 80 characters (see "Pathnames," earlier in this chapter, for more information on paths). Legal characters included any combination of letters and numbers, extended ASCII characters with values greater than 127, and the following punctuation characters:

$ % ^ ' ` - _ @ ~ ! ( ) # &

Spaces were not allowed.

Windows Vista supports long filenames (up to 260 characters), which can include spaces as well as these punctuation characters:

$ % ^ ' ` - _ @ ~ ! ( ) # & + , ; = [ ] .

For example, a file could be named Picture of my Niece.jpg and could be located in a folder named Family Photos. Furthermore, extensions are no longer limited to three characters; for example, .html is perfectly valid (and distinctly different from .htm). For more information on file types and extensions, see the discussions in the next section and in Appendix D.

The maximum length of any path in Windows Vista depends on the filesystem you're using (NTFS, FAT32, etc.).

2.7.5. File Types and Extensions

Most files have a filename extension, the (usually three) letters that appear after the last dot in any file's name. Here are some common file extensions:


An Excel spreadsheet


A text file (to be opened with Notepad)


A HyperText Markup Language (HTML) file, commonly known as a web page


A JPEG image file, used to store photos

Windows Vista includes a new document format, called XML Paper Specification (XPS), which uses the .xps extension. It is designed so that anyone can view the document, including its fonts, layout, graphics, and so on, even if he doesn't have the application that created it. In that way, it's much like the Adobe Acrobat .pdf format. Only those who have Vista or an XPS viewer will be able to view the document.

Although each of these files holds very different types of data, the only way Windows differentiates them is by their filename extensions. How Windows is able to determine a given file's type is important for several reasons, especially because it is the basis for the associations that link documents with the applications that created them. For example, when you double-click on a file named donkey.html, Windows looks up the extension in the Registry (see Chapter 13) and then, by default, opens the file in your web browser. Rename the file to donkey.jpg, and the association changes as well.

The lesson here is that filename extensions are not a reliable guide to a file's type, despite how heavily Windows Vista relies on them. What can make it even more frustrating is that, by default, known filename extensions are hidden by Windows Vista, but unfamiliar extensions are shown. Rename (an unassociated extension) to donkey.txt, and the extension simply disappears in Windows Explorer. Or, try to differentiate donkey.txt from donkey.doc when the extensions are hidden. To instruct Windows to show all extensions, go to Control Panel Appearance and Personalization Folder Options View, and turn off the "Hide file extensions for known file types" option.

To see all of the configured file extensions on your system, go to Start Default Programs Associate a file type or protocol with a program. You'll see a list of all your file types, along with the programs with which they are associated. To change the default program for any file type, highlight the file type, click "Change program," and then select the new program with which the file should be associated.

2.7.6. Using Windows Explorer

Click on a folder icon in Windows Explorer, and you'll see the contents of the folder. Look at the Preview Pane (it's on by default, but if it has been turned off for some reason, turn it on via Organize Layout) for the number of items in the folder.

Windows Explorer has received a major makeover with Windows Vista, and although the basic function is the same (navigating through your hard disk, viewing and using files, etc.), the layout and features have changed. (For a detailed look at Windows Explorer, see Chapter 4.) Figure 2-8 shows the major features of Windows Explorer.

Figure 2-8. The updated Windows Explorer

You can turn panes on and off by choosing Organize Layout, and selecting or deselecting the panes you want.

There's another major change to Windows Explorer with Windows Vistathe menus have vanished. To make them appear for a single task, press the Alt key. To keep them on permanently, choose Organize Folder and Search Options Layout View, and check the box next to Always show menus.

Depending on your settings, the files in the folder may be displayed in any of seven different ways: Tiles, Details, List, Small Icons, Medium Icons, Large Icons, and Extra Large Icons. In the Details view, each file is represented by a small icon, and several rows of information are displayed about each file, such as date created, date modified, size, and so on. In the List view, the files are displayed in a single long list. Small Icons, Medium Icons, Large Icons, and Extra Large Icons do exactly what they say: display each file as an icon representation, in whatever size you've chosen. (See Figure 2-9.) Different files will have different icon behaviors. With graphics files, for example, the icons are actual thumbnails of the graphic. But Word files display only the Word icon, not the actual content of the file itself. The Tiles view is a kind of combination of the List and Icon viewsit displays the files as tiled icons, without columns of details but with basic information about the file next to each tile, including the name, type, and size of the file.

Figure 2-9. Sort folder listings by clicking on column headers, or change column widths by dragging boundaries between the headers

If you're looking at a folder full of images, any of the icon views will be most useful. The Tiles view is worthwhile if you want to see small icons in addition to basic file information.

If you want to see previews of the actual content of your files, you can turn on the Preview Pane. It appears on the right and shows a thumbnail of the current file you've highlighted. The Preview Pane works in any view. To turn it on, select Organize Layout Preview Pane. The icon next to the Preview Pane on the menu will become highlighted in blue, and the pane turns on. To turn it off, select Organize Layout Preview Pane, and the highlight around the icon will vanish, as will the pane.

You can change the columns displayed in the Details view. Right-click on any column, and from the list that appears select the file types you want displayed. In addition, you can change the sort order and display of any column by hovering your mouse over the column until a down arrow appears, then clicking the down arrow. You'll be presented with ways in which you can sort and display that column.

In certain instances you can also turn on a Search Pane, which will appear just above the toolbar. The pane works in concert with the Search Bar. Type in a search term, and the Search Pane lets you easily filter your search results by file typesuch as Email, Pictures, and so onby clicking on the appropriate button. To turn the Search Pane on, select Organize Layout Search Pane. The Search Pane icon will be highlighted in blue on the menu, and the pane turns on. To turn it off, select Organize Layout Search Pane, and the highlight will vanish, as will the pane. However, the Search Pane is only available this way in a few folders, such as Desktop and Computer. If you choose Organize Layout in other folders, the Search Pane option will not be available. However, in any folder, if you type any text into the Search box, you can make the Search Pane appear by choosing Organize Layout Search Pane. But when you delete the text from the Search box, you won't have the option of turning on the Search Pane, except in a few select folders, such as Desktop and Computer.

Windows Vista will remember the view setting for each folder by default and will display it the same way the next time the folder is opened. (If a long time passes before you open a folder again, though, Windows will forget its settings.) You can turn this setting off by selecting Organize Folder Options View, unchecking the box next to "Remember each folder's view settings," and then clicking OK.

The Explorer Toolbar, like toolbars in most applications, provides quick access to some of the more frequently used features. The toolbar is context-sensitive; that is, it changes according to the content of the folder that you're viewing.

The Address Bar does more than just display your current folder; you also use it for navigation. Either move down the "bread crumb" trail that is displayed there, or else type the path to a folder and press Enter, and the folder's contents will be shown in the current window. This is often faster than navigating with the folder tree or using several consecutive folder windows. See Chapter 3 for details on using the Address Bar.

Although each new folder window you open will appear with Microsoft's default settings, it's possible to modify those defaults. Start by configuring a folder according to your preferences: choose the icon size, the sort order, and so on. Then, go to Organize Folder Options View, and click Apply to Folders. The setting will then be used for each new single folder window that is opened.

When you open a new folder, it opens in your existing Windows Explorer window. You can, however, have folders open in new windows instead. Choose Organize Folder Options General, select "Open each folder in its own window," and click OK.

2.7.7. Keyboard Accelerators in Folder Windows

Some keyboard accelerators are especially useful in Explorer and folder windows. You can use these in addition to the various keys described in "Point-and-Click Operations," earlier in this chapter.

  • Hold the Alt key while double-clicking on a file or folder to view the Properties window for that object.

  • Hover your mouse cursor over a file or folder to see basic information about the object, such as size, date modified, and so on.

  • Hold the Shift key while double-clicking on a folder to open an Explorer window (with the tree view) at that location. (Be careful when using this because Shift is also used to select multiple files. The best way is to select the file first.)

  • Press Backspace in an open folder to go to the parent (containing) folder.

  • Hold Alt while pressing the left cursor key to navigate to the previously viewed folder. Note that this is not necessarily the parent folder, but rather the last folder opened in Explorer. You can also hold Alt while pressing the right cursor key to move in the opposite direction (i.e., forward); this is similar to the Back and Next buttons in Internet Explorer, respectively. Windows Explorer also has Back and Next buttons.

  • Hold the Shift key while clicking on the close button (the x in the upper-right corner of the window on the menu bar) to close all open folders that were used to get to that folder. (This, of course, makes sense only in the single-folder view and with the "Open each folder in its own window" option turned on.)

  • Press Ctrl-A to quickly select all contents of a folderboth files and folders.

  • In Explorer or any single-folder window, press a letter key to quickly jump to the first file or folder starting with that letter. Continue typing to jump further. For example, pressing the N key in your \Windows folder will jump to nap. Press N again to jump to the next object that starts with N. Or, press N and then quickly press O to skip through the Ns and jump to notepad.exe. If there's enough of a delay between the N and the O keys, Explorer will forget about the N, and you'll jump to the first entry that starts with O.

2.7.8. Advanced Drag-and-Drop Techniques

Some of the basics of drag-and-drop are discussed in "Point-and-Click Operations," earlier in this chapter, but you can use some advanced techniques to have more control when you're dragging and dropping items. Naturally, it's important to be able to anticipate what will happen when you drag and drop an item before you actually do the dropping. The problem is that drag-and-drop is handled differently in various situations, so sometimes you'll need to modify your behavior to achieve the desired result. Here are the rules that Windows follows when determining how dropped files are handled:

  • If you drag an object from one place to another on the same physical drive (c:\docs to c:\files), the object is moved.

  • If you drag an object from one physical drive to another physical or network drive (c:\docs to d:\files), the object is copied, resulting in two identical files on your system.

  • If you drag an object from one physical or network drive to another and then back to the first drive, but in a different folder (c:\docs to d:\files to c:\stuff), you'll end up with three copies of the object.

  • If you drag an application executable (an EXE file), the same rules apply to it that apply to other objects, except that if you drag it into any portion of your Start menu or into any subfolder of your Start Menu folder, Windows will create a shortcut to the file. Dragging other file types (documents, script files, or other shortcuts) to the Start menu will simply move or copy them there, according to the preceding rules.

  • If you drag a system object (such as an item in the My Computer window or the Control Panel) anywhere, a shortcut to the item is created. This, of course, is a consequence of the fact that these objects aren't actually files and can't be duplicated or removed from their original locations.

  • If you drag system icons or items that appear within system folders, such as Documents, Internet Explorer, or the Recycle Bin, any number of things can happen, depending on the specific capabilities of the object. For example, if you drag a recently deleted file from the Recycle Bin, it will always be moved, because making a copy of, or a shortcut to, a deleted file makes no sense.

If you have trouble remembering these rules, or if you run into a confusing situation, you can always fall back on the information Windows provides you while you're dragging, in the form of the mouse cursor. A blue right-pointing arrow appears next to the pointer when copying, and a curved arrow appears when creating a shortcut. If you see no symbol, the object will be moved. This visual feedback is very important; it can eliminate a lot of mistakes if you pay attention to it.

Here's how to control what happens when you drag and drop an item:

  • To copy an object in any situation, hold the Ctrl key while dragging. Of course, this won't work for system objects such as Control Panel itemsa shortcut will be created regardless. Using the Ctrl key in this way will also work when dragging a file from one part of a folder to another part of the same folder, which is an easy way to duplicate a file or folder.

  • To move an object in any situation, hold the Shift key while dragging. This also won't work for system objects such as Control Panel itemsa shortcut will be created regardless.

  • To create a shortcut to an object in any situation, hold the Ctrl and Shift keys simultaneously while dragging. If you try to make a shortcut that points to another shortcut, the shortcut will simply be copied (duplicated).

  • To choose what happens to dragged files each time without having to press any keys, drag your files with the right mouse button, and a special menu will appear when the files are dropped. This context menu is especially helpful because it will display only options appropriate to the type of object you're dragging and the place where you've dropped it.

Part II: Nutshell Reference