6

MANAGING FILES AND SEARCHING

Understanding File Types

To get the most out of this chapter, you need to understand some background about what a file type is and how Windows 10 determines and works with file types. The next couple of sections tell you everything you need to know to get you through the rest of the chapter.

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 means that people care only about the documents they create and not about the applications they use to create those documents. 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. As you’ll learn in Chapter 24, “Tweaking and Customizing Windows,” Windows 10 hides file extensions by default, and this creates a whole host of problems, including

Confusion when trying to determine a file type based on a teensy icon

Not being able to edit extensions

Not being able to save a file under an extension of your choice

The risk of opening a virus program masquerading as a safe document

You can overcome all these problems by turning on file extensions, which you can do by checking the View tab’s File Name Extensions check box.

To learn more about file extensions, see “Turning On File Extensions,” p. 537.

The lack of file extensions causes such a fuss because file extensions determine the file type of a document. In other words, if Windows 10 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.

The file type, in turn, determines the application that’s associated with the extension. If a file has a .txt extension, Windows 10 associates that extension with Notepad, so the file will always open in Notepad. Nothing else inherent in the file determines the file type; therefore, at least from the point of view of the user, the entire Windows 10 file system rests on the scrawny shoulders of a dot and a few letters: 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: Windows displays a warning dialog box when you try to change an extension. Microsoft has also programmed a subtle behavior into the file system: When “display file extensions” is turned on and you activate the Rename command (click the file and then press F2), Windows 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 6.1. When you start typing, this obliterates the primary name but leaves the extension intact. This, at least, is very helpful.

Figure 6.1
When you activate the Rename command with file extensions turned on, Windows 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 10 file system, as you see in the rest of this chapter.

File Types and the Registry

Now, we’re going to get into the nitty-gritty here. If you want, you can skip this section. Still, knowing how things work can help you understand why things go awry in the ways they do. As you might expect, everything Windows 10 knows about file types is defined in the Registry. (See Chapter 29, “Editing the Windows Registry,” for the details on understanding and using the Registry.) Open the Registry Editor (in the taskbar’s Search box, type regedit, press Enter, and enter your UAC 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 10 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 associated with the registered extensions. When an extension is associated with a particular file type, the extension is said to be registered with Windows 10.

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 6.2. Here, we’ve selected the .txt key, which has txtfile as its Default value.

Figure 6.2
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 6.3 shows the txtfile subkey associated with the .txt extension. Here are some notes about this file type subkey:

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

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.

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, the Open action for a Text Document file type is the following:

%SystemRoot%system32NOTEPAD.EXE %1

Navigating Folder Windows

Let’s take a quick tour of the interface features you’ll find in folder windows. Figure 6.4 shows a typical example of the species, the Documents folder.

Figure 6.4
The main interface elements in a folder window.

Folder Navigation

Windows 10 implements drives and folders as hierarchies that you navigate up, down, and even across. As you can see in Figure 6.4, the Address bar doesn’t show any drive letters or backslashes. Instead, you get a hierarchical path to the current folder. The path in Figure 6.4 has three items, separated by right-pointing arrows:

Current folder icon—This icon represents the current folder. You’ll see a bit later that you can use this icon to navigate to your computer drives, your network, the Control Panel, your user folder, and more.

This PC—This represents the second level of the sample hierarchy. In the example, this level represents the contents of your PC, including its disk drives (both internal and external), the desktop, and your main user folders.

Documents—This represents the third level of the sample hierarchy. In the example, this level represents all the subfolders and files that reside in the user’s Documents folder.

tip

To copy the full path name (drive, folders, and filename) of the selected file, select Home, Copy Path.

This is a sensible and straightforward way to view the hierarchy. However, the real value here lies in the navigation features of the Address bar, and you can get a hint of these features from the nickname that many people have applied to the Address bar: the breadcrumb bar.

Breadcrumbing refers to a navigation feature that displays a list of the places a person has visited or the route a person has taken. The term comes from the fairy tale of Hansel and Gretel, who threw down bits of bread to help find their way out of the forest. This feature is common on websites where the content is organized as a hierarchy or as a sequence of pages.

Windows 10 implements breadcrumb navigation not only by using the Address bar to show you the hierarchical path you’ve taken to get to the current folder but also by adding interactivity to the breadcrumb path:

You can navigate back to any part of the hierarchy by clicking the folder name in the Address bar. For example, in the path shown in Figure 6.4, you could jump immediately to the top-level hierarchy by clicking This PC in the path.

You can navigate “sideways” to any part of any level by clicking the right-pointing arrow to the right of the level you want to work with. In Figure 6.5, for example, you see that clicking the arrow beside the current folder icon displays a list of the other navigable items, such as Homegroup, Network, and Control Panel. Clicking an item in this list opens that folder.

Figure 6.5
Breadcrumb navigation: In the Address bar, click a folder’s arrow to see a list of the navigable items in that folder.

Instant Search

The next major element in the Windows 10 folder window interface is the Search box, which appears to the right of the Address bar in all folder windows. Search is everywhere in Windows 10, and we go into it in much more detail later in this chapter (see “Searching Your PC”). For folder windows, however, the Instant Search box gives you a quick way to search for files within the current folder. Most of us nowadays have folders that contain hundreds or even thousands of documents. To knock such folders down to size in Windows 10, you need only type all or part of a filename, and Windows 10 filters the folder contents to show just the matching files, as shown in Figure 6.6. Windows 10 also matches those files that have metadata—such as the author or tags—that match your text.

Figure 6.6
With Instant Search, Windows 10 displays just those files with names or metadata that match your search text.

This is one of the most important things to remember about Windows today: don’t click around and try to look for things by hand; let Windows search for you.

The Ribbon

Windows 10’s version of the venerable File Explorer file management program comes with a ribbon interface that replaces the menu bar and toolbar in versions prior to Windows 8. As with all ribbons, File Explorer’s is divided into several tabs: File, Home, Share, and View. Also, when you open certain folders or activate certain features, the ribbon sprouts extra contextual tabs that display commands related to the folder or feature. For example, in Figure 6.6 you can see that when you run a search, File Explorer adds the Search Tools contextual tab to the ribbon.

The Navigation Pane

The Navigation pane appears on the left side of each folder window, and it offers quick links to the major sections of your system, including your OneDrive, This PC, Network, and Homegroup. The Quick Access section offers access to a few common folders, including Desktop and Downloads, and it displays folders that you’ve visited frequently.

tip

The Quick Access section is fully customizable. For example, you can add a link to one of your own favorite folders by clicking and dragging that folder and dropping it inside the Quick Access section. (You can also right-click the item and then click Pin to Quick Access.) If a frequently used folder appears in Quick Access, you can keep it there by pinning it. (Right-click it and then click Pin to Quick Access.) You can also remove links you don’t use. (Right-click a link under Quick Access and click Unpin from Quick Access.)

We use this ability all the time. When we start a project, we put the folder that contains all of its documents into the Quick Access list. When the project’s done, we remove it so the list doesn’t get cluttered.

Basic File and Folder Chores

Now that you’re familiar with Windows 10’s folders, it’s time to put them through a workout. The next few sections take you through a few basic file and folder chores, including selecting, moving and copying, and renaming.

Selecting Files with Check Boxes

In this chapter, you learn about quite a few substantive elements in the Windows file system: metadata, searching, grouping, filtering, and more. All these are fairly sophisticated and useful technologies. However, sometimes it’s the small, mundane elements that make your life with an operating system easier and more efficient. In this section, you learn about one of our favorites of Windows 10’s many small but quite useful tweaks: a technique that affects the way you select files.

When you need to select multiple, noncontiguous objects, the easiest method is to hold down the Ctrl key and click each item you want to select. However, when we use this technique to select more than a few files, we always end up accidentally selecting one or more files that we don’t want. It’s not a big deal to deselect these extra files, but it’s one of those small drains on productivity that bugs us (and many other users).

Windows 10 offers a file-selection technique that promises to eliminate accidental selections. With this technique, you use a check box to select individual files and folders. To activate this feature, display File Explorer’s View tab and then check the Item Check Boxes box.

tip

Bonus technique: You can also select all the items in the folder quickly by clicking the check box that appears at the top of the Name column.

As you can see in Figure 6.7, when you turn on this feature, Explorer creates a column to the left of the folder contents in Details view. When you point at a file or folder, a check box appears in this column, and you select an item by activating its check box. You don’t need to hold down Ctrl or use the keyboard at all. Just check the boxes for the files and folders you want to select.

Figure 6.7
In Windows 10, you can select files and folders using check boxes.

Resolving File Transfer Conflicts

When you move or copy a file into the destination folder, it sometimes happens that a file with the same name already resides in that folder. In earlier versions of Windows, you’d see a dialog box asking whether you want to replace the existing file, and you’d click Yes or No, as appropriate. Unfortunately, Windows didn’t give you much information to go on to help you make the choice. Windows 10 takes a step in the right direction by displaying the Replace or Skip Files dialog box instead. Figure 6.8 shows an example.

Figure 6.8
This dialog box appears if a file with the same name already exists inside the destination folder.

Understanding Size on Disk

To see the total size of the objects in the current selection, right-click the selection and then click Properties. Windows 10 counts all the files, calculates the total size as well as the total size on the disk, and then displays this data in the General tab on the property sheet that appears.

What’s the difference between the Size and Size on Disk values? Windows 10 stores files in discrete chunks of hard disk space called clusters, which have a fixed size. This size depends on the file system and the size of the partition, but 4KB is typical. The important point to remember is that Windows 10 always uses full clusters to store all or part of a file. For example, suppose that you have two files: one that’s 2KB and another that’s 5KB. The 2KB file will be stored in an entire 4KB cluster. For the 5KB file, the first 4KB of the file will take up a whole cluster, and the remaining 1KB will be stored in its own 4KB cluster. Therefore, the total size of these files is 7KB, but they take up 12KB on the hard disk.

This dialog box gives you the following choices:

Replace the File in the Destination—Click this option if you want the file you are copying (or moving) to replace the existing file.

Skip This File—Click this option if you want Windows 10 to not copy (or move) the file, so the original remains in the destination folder.

Compare Info for Both Files—Click this option to see more information about both files, including a thumbnail, the last modified date, and the size. Check the box for the version you want to keep, and then click Continue. Note, too, that you can keep both files by activating both check boxes and then clicking Continue. In this case, the existing file remains as is, and the file being copied or moved is placed in the folder with (2) appended to the filename.

Expert Drag-and-Drop Techniques

You’ll use the drag-and-drop technique throughout your Windows career. To make drag-and-drop even easier and more powerful, here are a few pointers to bear in mind:

“Lassoing” multiple files—If the objects you want to select are displayed in a block within the folder list, you can select them by dragging a box around the objects. This is known as lassoing the objects.

Drag-and-scroll—Most drag-and-drop operations involve dragging an object from the contents area and dropping it on a folder in the Folders list. (Be sure to display the Folders list first.) If you can’t see the destination in the Navigation pane, drag the pointer to the bottom of the pane. File Explorer will scroll the pane up. To scroll the pane down, drag the object to the top of the pane.

Drag-and-open—If the destination is a subfolder within an unopened folder branch, drag the object and hover the pointer over the unopened folder. After a second or two, File Explorer opens the folder branch.

Inter-window dragging—You can drag an object outside of the window and then drop it on a different location, such as the desktop.

Drag between Explorer windows—Windows 10 lets you open two or more copies of File Explorer (select File, Open New Window). If you have to use several drag-and-drop operations to get some objects to a particular destination, open a second copy of File Explorer and display the destination in this new window. You can then drag from the first window and drop into the second window.

Canceling drag-and-drop—To cancel a drag-and-drop operation, either press Esc or click the right mouse button. If you’re right-dragging, click the left mouse button to cancel.

Taking Advantage of the Send To Command

For certain destinations, Windows 10 offers an easier method for copying or moving files or folders: the Send To command. To use this command, select the objects you want to work with, right-click the selection, and then click Send To in the shortcut menu. You see a submenu of potential destinations, as shown in Figure 6.9.

Figure 6.9
The Send To command offers a menu of possible destinations.

Note that the items in this menu (except the disk drives) are taken from the following folder that contains shortcut files for each item:

%UserProfile%appdata
oamingMicrosoftWindowsSendTo

This means that you can customize the Send To menu by adding, renaming, and deleting the shortcut files in your SendTo folder.

note

The user profile folder for a user is the following:

%SystemDrive%UsersUser

Here, %SystemDrive% is the drive on which Windows 10 is installed (such as C:), and User is the person’s username. Windows 10 stores the user profile folder for the current user in the %UserProfile% environment variable.

Click the destination you want, and Windows 10 sends the object there. What do we mean by send? We suppose that drop would be a better word because the Send To command acts like the drop part of drag-and-drop. Therefore, Send To follows the same rules as drag-and-drop:

If the Send To destination is on a different disk drive, the object is copied.

If the Send To destination is on the same disk drive, the object is moved.

Forcing a Move or Copy

With both Send To and drag-and-drop operations, you can force Windows to either copy or move the file(s) you’ve selected.

With drag-and-drop, before you release the mouse to drop the selected file(s), there is some visual feedback of what is going to happen: You will see a + appear on the icon(s) you’re moving if you’re about to do a copy rather than a move. If you remember to check for this before you release the mouse, you’ll have the chance to change it before the wrong thing happens. Hold the Shift key down to turn a Copy into a Move, or hold the Ctrl key down to turn a Move into a Copy. Then, while you’re holding the key down, release the icon(s).

With Send To, to force a move, hold down Shift when you select the Send To command. To force a copy, hold down Ctrl when you select the Send To command. To force a shortcut, hold down Shift and Ctrl when you select the Send To command.

The Recycle Bin: Deleting and Recovering Files and Folders

In our conversations with Windows users, we’ve noticed an interesting trend that has become more prominent in recent years: People don’t delete files as often as they used to. We’re sure that the reason for this is the absolutely huge hard disks that are offered these days. Even entry-level systems come equipped with 1TB disks, and multi-terabyte-sized drives are no longer a big deal. Unless someone’s working with digital video files, even a power user isn’t going to put a dent in these massive disks any time soon. So, why bother deleting anything?

Although it’s always a good idea to remove files and folders you don’t need (it makes your system easier to navigate, it speeds up defragmenting, and so on), avoiding deletions does have one advantage: You can never delete something important by accident.

tip

If you’re absolutely sure you don’t need an object, you can permanently delete it from your system (that is, bypass the Recycle Bin) by selecting it and pressing Shift+Delete.

Just in case you do, however, Windows 10’s Recycle Bin can bail you out. The Recycle Bin icon on the Windows 10 desktop is actually a front end for a collection of hidden folders named Recycled that exist on each hard disk volume. The idea is that when you delete a file or folder, Windows 10 doesn’t actually remove the object from your system. Instead, the object moves to the Recycled folder on the same drive. If you delete an object by accident, you can go to the Recycle Bin and return the object to its original spot. Note, however, that the Recycle Bin can hold only so much data. When it gets full, it permanently deletes its oldest objects to make room for newer ones.

It’s important to note that Windows 10 bypasses the Recycle Bin and permanently deletes an object under the following circumstances:

note

OneDrive has its own online Recycle Bin for your OneDrive folder, but it uses it only if you use the web interface for OneDrive; when you delete from the local cache of OneDrive, the deleted item goes to your local Recycle Bin.

When you delete the object from a removable drive

When you delete the object from the command line

When you delete the object from a network drive

Setting Some Recycle Bin Options

The Recycle Bin has a few properties you can set to control how it works. To view these properties, right-click the desktop’s Recycle Bin icon and then click Properties. Windows 10 displays the Recycle Bin Properties dialog box shown in Figure 6.10.

Figure 6.10
Use this dialog box to configure the Recycle Bin to your liking.

Here’s a rundown of the various controls:

Recycle Bin Location—Choose the Recycle Bin you want to configure: You see an icon for each of the hard drive partitions on your computer.

Custom Size—Enter the size of the Recycle Bin. The larger the size, the more disk space the Recycle Bin takes up, but the more files it will save before permanently deleting them.

Don’t Move Files to the Recycle Bin—If you activate this option, all deletions are immediate and permanent.

Display Delete Confirmation Dialog—For the first time in Windows history, Windows 10 does not ask for confirmation when you delete an object. If you miss the prompt, or if you just want to be super careful about deletions, check this box.

tip

You can clean out your Recycle Bin at any time by right-clicking the desktop’s Recycle Bin icon and then clicking Empty Recycle Bin. The Recycle Bin contents can also be purged using Windows 10’s Disk Cleanup utility.

Click OK to put the new settings into effect.

Recovering a File or Folder

If you accidentally delete the wrong file or folder, you can return it to its rightful place by using the following method:

1. Open the desktop’s Recycle Bin icon, or open any Recycled folder in File Explorer.

2. Select the object you want to restore.

3. Click the Manage tab and then click Restore the Selected Items. (You can also right-click the file and then click Restore.)

Undoing a File or Folder Action

If deleting the file or folder was the last action you performed in File Explorer, you can recover the object by selecting the Edit, Undo Delete command (or by pressing Ctrl+Z). Note, too, that Windows 10 enables you to undo the ten most recent actions.

File Maintenance Using the Open and Save As Dialog Boxes

One of the best-kept secrets of Windows 10 is the fact that you can perform many of these file maintenance operations within two of Windows 10’s standard dialog boxes:

Open—In most applications, you display this dialog box by selecting the File, Open command, or by pressing Ctrl+O.

Save As—You usually display this dialog box by selecting File, Save As. Or, if you’re working with a new, unsaved file, you select File, Save, or press Ctrl+S.

Most of the time, the dialog that appears for Open or Save operations is a full-scale File Explorer window, in which you can do anything that File Explorer can do before you finally choose a file to open or save. Here are several techniques you can use within these dialog boxes:

To perform maintenance on a file or folder, right-click the object to display a shortcut menu like the one shown in Figure 6.11. In particular, note that you can click Cut to move an item, click Copy to copy an item, navigate to the destination folder, and then click Paste to complete the move or copy.

Figure 6.11
You can perform most basic file and folder maintenance right from the Open and Save As dialog boxes.

You can click and drag files or folders and drop them on any local or OneDrive folder that appears in the Navigation pane.

To create a new object, right-click an empty section of the file list and then click New to get the New menu.

To create a new folder within the current folder, click the New Folder button.

Metadata and the File Explorer Property System

We mentioned earlier that Windows is gradually lessening the importance not only of drive letters but also specific file locations. If file location will become less important, what can you use to take its place as a basis for file organization? Content seems like a pretty good place to start. After all, it’s what’s inside the documents that really matters. For example, suppose you’re working on the Penske account. It’s a pretty good bet that all the Penske-related documents on your system actually have the word Penske inside them somewhere. If you want to find a Penske document, a file system that indexes document content sure helps because then you need only do a content search on the word Penske.

However, what if a memo or other document comes your way with an idea that would be perfect for the Penske account, but that document doesn’t use the word Penske anywhere? This is where purely content-based file management fails because you have no way of relating this new document with your Penske documents. Of course, you could edit the new document to add the word Penske somewhere, but that’s a bit kludgy and, in any case, you might not have write permission for the file. It would be far better if you could somehow identify all of your documents that have “Penske-ness”—that is, that are directly or indirectly related to the Penske account.

This sounds like a job for metadata, and that’s fine because metadata is nothing new in the Windows world:

Digital photo files often come with their own metadata for things such as the camera model and image dimensions, and some imaging software enables you to apply tags to pictures.

In Windows Media Player, you can download album and track information that gets stored as various metadata properties: Artist, Album Title, Track Title, and Genre, to name just a few.

The last few versions of Microsoft Office have supported metadata via the File, Properties command.

For all file types, Windows displays in each file’s property sheet a Summary tab that enables you to set metadata properties such as Author, Comments, and Tags.

In Windows 10, metadata is an integral part of the operating system. With the Windows Search engine, you can perform searches on some or all these properties (see “Searching Your PC,” later in this chapter). You can also use them to group and filter files (see “Grouping and Filtering with Metadata,” later in this chapter).

To edit a document’s metadata, you can use two methods in Windows 10:

In File Explorer, select View, Details Pane. In the Details pane that now appears on the right side of the window, click the property you want to edit. Windows 10 displays a text box in which you can type or edit the property value. For example, Figure 6.12 shows a photo’s Title property being edited. Click Save when you’re done.

Figure 6.12
You can edit a document’s configurable metadata directly in the Details pane.

Right-click the document and click Properties to display the property sheet, and then click the Details tab. This tab displays a list of properties and their values. To edit a property, click inside the Value column to the right of the property.

note

By default, in most folder windows, Windows 10 displays the Tags and Type properties in File Explorer’s Details view. (Specialized folders such as Music, Pictures, and Videos display other properties in Details view.) To toggle a property’s column on and off, right-click any column header and then click the property. Click More to see a complete list of the available properties.

Searching Your PC

We mentioned earlier that one of the consequences of having massive hard drives is that people tend not to delete files as often as they used to. This means you always have access to your files, but first, you have to find them, and the more data you store on your PC, the harder it gets to locate the data you need.

The good news with Windows 10 is that desktop searching—which disappeared in Windows 8/ 8.1—is back. As you could in Windows 7, you can quickly search your system from the desktop, but instead of using the Start menu, you use the taskbar’s Search box. When you type a search string, Windows 10 generates a list of matching items on your PC—including Modern apps, desktop programs, settings, and documents—as well as matching items from the Windows Store and the web (see Figure 6.13). For the web, you can view the search results without having to open Microsoft Edge by clicking the arrow to the right of the “See web results” text, as pointed out in Figure 6.13.

Figure 6.13
Use the taskbar’s Search box to run quick desktop searches in Windows 10.

If too many items appear, or if you don’t see the item you’re looking for, you can filter the results quickly by clicking Apps, Documents, or Web at the top of the results. For more choices, click Filters at the top-right of the search window to choose a category within which to search. As you can see in Figure 6.14, you can narrow the results to various local and Internet categories: Apps, Documents (names and contents), Folders (that is, folder names), Music, and so on. Click a category to see that subset of the results. Note, too, that Documents, Photos, Videos, and Music show the matching items not only from your PC, but also from your OneDrive.

Figure 6.14
Clicking Filters lets you restrict the search results to a specific category.

Desktop searching is powerful in Windows 10 because it uses the Windows Search service, which starts automatically each time you load Windows 10. On the downside, it can still take Windows 10 a long time to search, say, all of drive C. However, that’s because Windows Search does not index the entire drive. Instead, it just indexes your user account data, your offline files (local copies of network files), and your email messages. If you’re searching for one of these indexed locations, Windows 10 searches are lightning quick.

Note that you can control what Windows Search indexes and force a rebuild of the index by opening File Explorer, clicking inside its Search box to display the Search pane in the ribbon, and then selecting Advanced Options, Change Indexed Locations. (You can also open Control Panel and click Indexing Options.) This displays the dialog box shown in Figure 6.15. To customize the search engine, you have two choices:

Figure 6.15
Use the Indexing Options dialog box to control the Windows Search engine.

Modify—Click this button to display the Indexed Locations dialog box, which enables you to change the locations included in the index. Check the box for each drive or folder you want to include.

Advanced—Click this button to display the Advanced Options dialog box, which enables you to index encrypted files, change the index location, specify the file types (extensions) you want to include in or exclude from the index. You can also click Rebuild to re-create the index.

caution

Windows Search takes a long time to index even a relatively small amount of data. If you’re asking Windows Search to index dozens of gigabytes of data, wait until you’re done working for the day and let the indexer run all night.

As-You-Type Searches with Instant Search

You can also perform desktop-based as-you-type searches in any folder by using the Search box that appears in every File Explorer window.

What gets searched depends on several things:

If you just want to search within a folder, display that folder before clicking inside the Search box. By default, Windows searches within subfolders as well. To turn that off, click All Subfolders in the ribbon’s Search tab.

If you want to search your entire computer, either display the This PC folder and then run the search or click inside the Search box and then click This PC in the ribbon’s Search tab.

If you want to search your user account, click the arrow next to the current folder icon in the Address bar (see Figure 6.5, earlier in this chapter), click your user account in the list, and then run the search.

tip

In a folder window, you can access the Search box via the keyboard by pressing Ctrl+E.

Whatever location you choose, as you type, Explorer displays those files in the location with names or metadata that matches your search text, as shown earlier in Figure 6.6.

Using Advanced Query Syntax to Search Properties

When you run a standard text search from any File Explorer Search box, Windows looks for matches not only in the filename and the file contents, but also in the file metadata—the properties associated with each file. That’s cool and all, but what if you want to match only a particular property? For example, if you’re searching your music collection for albums that include the word Rock in the title, a basic search on rock will also return music in which the artist’s name includes rock and the album genre is Rock. This is not good.

To fix this kind of thing, you can create powerful and targeted searches by using a special syntax—called Advanced Query Syntax (AQS)—in your search queries.

For file properties, you use the following syntax:

property:value

Here, property is the name of the file property you want to search on, and value is the criteria you want to use. The property can be any of the metadata categories used by Windows. For example, the categories in a music folder include Name, Track, Title, Artists, Album, and Rating. Right-click any column header in Details view to see more properties such as Genre and Length, and you can click More to see the complete list.

You can also access these properties using the controls in the Search tab’s Refine group. (Click inside File Explorer’s Search box to see the Search tab.) For example, you can use the Date Modified, Kind, and Size lists to construct query strings for those properties, and you can use the Other Properties list to access more properties. (The ones you see depend on the current folder.)

Here are a few things to bear in mind when constructing AQS strings:

If the property name is a single word, use that word in your query. For example, the following code matches music where the Artists property is Coldplay:

artists:coldplay

If the property name uses two or more words, remove the spaces between the words and use the resulting text in your query. For example, the following code matches pictures where the Date Taken property is August 23, 2018:

datetaken:8/23/2018

If the value uses two or more words and you want to match the exact phrase, surround the phrase with quotation marks. For example, the following code matches music where the Genre property is Alternative & Punk:

genre:”alternative & punk”

If the value uses two or more words and you want to match both words in any order, surround them with parentheses. For example, the following code matches music where the Album property contains the words Head and Goats in any order:

album:(head goats)

If you want to match files where a particular property has no value, use empty braces, [], as the value. For example, the following code matches files where the Tags property is empty:

tags:[]

You can also refine your searches with the following operators and wildcards:

>

Matches files where the specified property is greater than the specified value. For example, the following code matches pictures where the Date Taken property is later than January 1, 2018:

datetaken:>1/1/2018

>=

Matches files where the specified property is greater than or equal to the specified value. For example, the following code matches files where the Size property is greater than or equal to 10,000 bytes:

size:>=10000

<

Matches files where the specified property is less than the specified value. For example, the following code matches music where the Bit Rate property is less than 128 (bits per second):

bitrate:<128

<=

Matches files where the specified property is less than or equal to the specified value. For example, the following code matches files where the Size property is less than or equal to 1024 bytes:

size:<=1024

..

Matches files where the specified property is between (and including) two values. For example, the following code matches files where the Date Modified property is between August 1, 2018 and August 31, 2018, inclusive:

datemodified:8/1/2018..8/31/2018

*

Substitutes for multiple characters. For example, the following code matches music where the Album property includes the word Hits:

album:*hits

?

Substitutes for a single character. For example, the following code matches music where the Artists property begins with Blu and includes any character in the fourth position:

artists:blu?

For even more sophisticated searches, you can combine multiple criteria using Boolean operators:

AND (or +)

Use this operator to match files that meet all of your criteria. For example, the following code matches pictures where the Date Taken property is later than January 1, 2018 and the Size property is greater than 1,000,000 bytes:

datetaken:>1/1/2018 AND size:>1000000

OR

Choose this option to match files that meet at least one of your criteria. For example, the following code matches music where the Genre property is either Rock or Blues:

genre:rock OR genre:blues

NOT (or )

Choose this option to match files that do not meet the criteria. For example, the following code matches pictures where the Type property is not JPEG:

type:NOT jpeg

note

The Boolean operators AND, OR, and NOT must appear in all-uppercase letters in your query.

Saving Searches

After taking all that time to get a search just right, it would be a real pain if you had to repeat the entire procedure to run the same search later. Fortunately, Windows 10 takes pity on searchers by enabling you to save your searches and rerun them anytime you like. After you run a File Explorer search, you save it by following these steps:

1. In the ribbon’s Search tab, click the Save Search button. The Save As dialog box appears.

2. Type a name for the search.

3. By default, Windows 10 saves your searches in the Searches folder, appropriately enough. However, you’re free to use the Save As dialog box to save your search anywhere that’s most convenient, including the desktop.

4. Click Save.

Grouping and Filtering with Metadata

Metadata is a useful file system element, but people might not be motivated to apply metadata to their documents unless they can be convinced that metadata is worth the short-term hassle. The Windows programmers seem to understand this because they built two file-management techniques into File Explorer, both of which become more powerful and more useful the more metadata you’ve applied to your files. These techniques are grouping and filtering.

Grouping Files

Grouping files means organizing a folder’s contents according to the values in a particular property. In the Windows 10 version of File Explorer, select the ribbon’s View tab and then click Group By. This displays a list of the properties you can use for the grouping. Clicking one of these properties groups the files according to the values in that property. Figure 6.16 shows the Documents folder grouped by the values in the Type property.

Figure 6.16
Windows 10 enables you to group and work with files based on the values in a property.

As Figure 6.16 shows, Windows 10 enhances the grouping feature with two techniques:

You can select all the files in a group by clicking the group title.

You can collapse the group (that is, show just the group title) by clicking the arrow to the left of the group title. (You can collapse all the groups by right-clicking any group title and then clicking Collapse All Groups.)

Filtering Files

Filtering files means changing the folder view so that only files that have one or more specified property values are displayed. Returning to the Type property example, you could filter the folder’s files to show only those where Type was, say, JPG File or File Folder.

In Details view, when you pull down the list associated with a property’s header (hover the mouse over the property and a down arrow appears, which you click to display the associated list), you see an item for each discrete property value, along with a check box for each value. To filter the files, check the boxes for the property values you want to view. For example, in Figure 6.17 we’ve checked the boxes beside the Doc File, DOCM File, and Office Open XML Document values in the Type property, and only those three types appear in the folder.

Figure 6.17
You can filter a folder to show only those files that have the property values you specify.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.134.87.95