The primary tool for managing files in Microsoft Windows 11, regardless of where they are located, is File Explorer (the direct descendant of what was known as Windows Explorer in Windows 7 and earlier versions). File Explorer is an amazingly powerful tool, filled with features that can streamline your work processes and make it easier to find files of all types, regardless of where they’re stored. Most Windows users barely scratch the surface of File Explorer, which is why we devote a significant section of this chapter to a master class in its rich feature set.
In Windows 11, Microsoft has significantly streamlined the user interface of File Explorer, removing the Office-style ribbon from its immediate predecessor and replacing it with a single command bar. A much more significant change is the version 22H2 addition of a tabbed interface that allows you to organize open folders the way you manage multiple tabs in a modern web browser.
Perhaps more than any other feature in Windows, the search tools have the potential to change the way you work. If your filing philosophy involves the digital equivalent of throwing everything into a giant shoebox, you’ll be startled at how easy it is to find what you’re looking for. Even if you consider yourself an extremely well-organized Windows user, we predict you’ll find ways to integrate File Explorer’s search tools into your everyday routine.
You can’t become a Windows expert without learning how to move quickly and confidently through File Explorer. This general-purpose tool is used throughout Windows for all sorts of file-management tasks, for opening and saving files in Windows apps, and even in parts of the Windows shell. The more you understand about how File Explorer works, the more effective you’ll be at speeding through tasks without unnecessary delays. Because it’s vital to know your way around, we begin this section with a short tour.
Figure 9-1 shows the default File Explorer layout.
Figure 9-1 File Explorer includes the navigation and display elements shown here, some of which can be customized.
In the transition from Windows 10 to Windows 11, File Explorer received a serious makeover. The most visible change was the removal of the Office-style ribbon, which is replaced by a simpler command bar. The navigation pane adds a Home icon at the top; clicking Home displays a contents pane with three regions, holding shortcuts to pinned folders and recently used folders (Quick Access), pinned files (Favorites), and recently accessed files (Recent). Beginning with version 22H2, File Explorer also offers the option to display the contents of folders in separate tabs within a single window.
The disappearance of the File Explorer ribbon means you might have to search harder to find menu options you’re looking for. If you’re looking to display the details or preview panes, for example, you have to go three levels deep in the menus: View > Show > Details Pane (or Preview Pane). The Show menu is also where you find options to display item checkboxes (which make it easier to select multiple items without holding down shortcut keys) or to display file name extensions (which are normally hidden).
The See More menu, represented by the ellipsis at the right side of the command bar, contains some useful menu options: Select All, Select None, and Invert Selection, for example. (That last option is a great way to select a large number of files while leaving only a few unselected. Control+click to select the files you want to leave unselected, then click the Invert Selection option to select all the remaining files and clear the ones you previously selected.) A Copy As Path menu option is also here, which is useful when you want to work with a specific file in a Command Prompt or PowerShell window.
As is the case elsewhere in Windows, right-clicking any object (or a blank space in a window) is often the most effective way to get things done. In Windows 11, right-clicking in File Explorer reveals a simplified shortcut menu that usually, but not always, has the option you’re looking for on it. If you need access to an option that isn’t on this short menu, click Show More Options (or press Shift+F10) to see the full, old-style menu. Figure 9-2 shows the short menu (left) and the corresponding full menu (right).
Figure 9-2 By default, right-clicking menus in File Explorer shows a simplified selection of commands (left). Click Show More Options to see the full menu (right).
If you’re accustomed to seeing the most common file operations—Cut, Copy, Paste, Rename, and so on—listed as options on the shortcut menu, you’re likely to be confused by the simplified shortcut menus, at least at first. As Figure 9-2 shows, those commands now appear as icons at the top or bottom of the shortcut menu.
After File Explorer is open, you have a wide assortment of keyboard shortcuts to choose from. Pressing Ctrl+N opens a new window on the same folder. Ctrl+W closes the current window. The following additional keyboard shortcuts work in File Explorer:
Alt+Up Arrow Go up one level.
Alt+Left Arrow Go to previous folder in history.
Alt+Right Arrow Go to next folder in history.
Alt+D Move the focus to the address bar and select the current path.
Ctrl+T Open a new tab.
Ctrl+Tab Move to the next tab.
Ctrl+Shift+Tab Move to the previous tab.
F4 Move the insertion point to the address bar and display the contents of the dropdown menu of previous addresses.
Alt+Enter Show properties of the selected file.
Tab Cycle through the following elements: tabs, navigation controls, column headings, navigation pane, address bar, search box.
F11 Switch in and out of full-screen mode.
Ctrl+Shift+N Create a new subfolder in the current folder.
Ctrl+Shift+E Expand the navigation pane to the current folder.
In its default arrangement, the navigation pane on the left is arranged into nodes that expand and collapse on demand. As part of its redesign for Windows 11, this pane now consists of three zones:
The top zone contains a Home icon, which displays the Home page; it also displays nodes for any OneDrive and OneDrive for Business accounts that are connected to the current user profile.
The middle zone displays pinned and recent folders—the same as the Quick Access list on the Home page.
The bottom zone shows This PC, which expands to show all local drives, followed by separate nodes for libraries, removable drives, for the local network, and for third-party cloud service providers.
Each of the top-level nodes in the navigation pane offers a starting point for navigating through files in its associated location. Note that you can right-click any empty space in the navigation pane to display a menu that allows you to show or hide the nodes for This PC and Network. You can also choose to show or hide the Libraries node. (For more on how Windows uses libraries to organize files, see “Using libraries” later in this chapter.)
If you prefer the older, tree-style view with a single hierarchy, right-click an empty space in the navigation pane and choose Show All Folders. With the Show All Folders option selected, the navigation pane includes your profile folders (which you can expand by clicking your username in the navigation pane), removable drives (which also appear directly under This PC), OneDrive accounts, SharePoint sites, Control Panel, Recycle Bin, and any folders you’ve created directly on the desktop.
If you simply want to see the files in a folder without being distracted by the navigation pane, you can make it disappear with ease: Click View > Show and clear the checkbox to the left of the Navigation Pane menu entry. You might choose this option if you’re comparing the contents of two folders in side-by-side windows and don’t need the distraction of the navigation pane.
In Windows 11, the Home page takes the place of Quick Access, which appeared at the top of the navigation pane in Windows 10. When Home is selected, the contents pane displays three groups of shortcuts, giving you ready access to the folders and files you use most frequently.
Quick Access is no longer a top-level node in the navigation pane; instead, it’s a place where you can collect shortcuts to folders you use regularly. Windows automatically pins the Desktop, Downloads, Documents, and Pictures folders here. To add to that selection, right-click any folder and choose Pin To Quick Access. You can unpin a pinned folder by right-clicking it and then clicking Unpin From Quick Access.
In addition to pinned folders, Quick Access includes folders you’ve worked with recently, in a lineup that shifts depending on your work habits.
The section immediately below Quick Access, Favorites, offers similar access to individual files. Any files you tag as Favorites in Office apps (Word, Excel, and so on) are automatically included here. You can also right-click any file and choose Add To Favorites to pin it to this list. (Note that unlike the folders in Quick Access, pinned files in Favorites do not include a pin icon.) To remove a file from the Favorites list, right-click and then click Remove From Favorites.
The Recent Files section of Quick Access contains files you recently worked with, sorted with the most recently used one at the top. By right-clicking a file name and clicking Open File Location, you can go directly to the folder in which the file resides. If you find that you no longer need to see a particular file in this list and want to make room for another, you can right-click that file and then click Remove From Recent.
File Explorer’s Home page is an extremely handy navigational tool, because it gathers together the stuff you’re most likely to be concerned with, regardless of where that stuff is actually stored. But if you don’t need it, or you’re not keen on having other people see what you’ve been working on when they peer over your shoulder, you can tell Windows not to add files or folders unless you specifically pin them. To do this, click See More > Options. On the General tab of the Folder Options dialog, the checkboxes you need are in the Privacy section, as shown in Figure 9-3.
Figure 9-3 Use the checkboxes under the Privacy heading to tell Windows not to automatically display recently used files and folders on the File Explorer Home page.
(If you just want to cover your immediate tracks without changing the overall behavior of File Explorer, it’s probably simpler to click Clear in the Privacy section.)
You can adjust the display of any individual folder’s contents in File Explorer by means of options on the View menu. Your choices are numerous: Icons (in four sizes), List, Details, Tiles, and Content. Display options are folder-specific and persistent.
The range of options for the various icon views is larger than it looks. Although there are four discrete choices available at the top of the View menu—Extra Large Icons, Large Icons, Medium Icons, and Small Icons—the actual number of sizes is 76. You can cycle smoothly through all 76 sizes by choosing one of the four preset sizes and then holding down the Ctrl key as you turn the wheel on your mouse or scroll up or down with two fingers on a trackpad. With each step, you see the icons grow or shrink (although at some of the smaller sizes, the change is barely perceptible).
The remaining four options work as follows:
List This view is extremely efficient, displaying file names only, arranged in columns.
Details This view is one of the most important alternatives, offering a multicolumn tabulation of your files that unlocks a wide range of sorting, filtering, and grouping options, as we discuss later in this chapter, “Sorting, filtering, and grouping in File Explorer.”
Tiles Choose this view to display each file and folder in a single rectangle that displays a thumbnail (or icon, for files that don’t support thumbnails) with the file name, type, and size in three lines of text to the right of the thumbnail.
Content In this view, listings are arranged in multiline bands that take up the full width of the window.
One additional option, Compact View, shrinks the spacing between items in the navigation pane and, in List and Details views only, between items in the contents pane.
The default arrangement of column headings in Details view is determined by the folder type, but you can tailor this arrangement in any folder. To add or remove a column heading, right-click anywhere in the row of column headings. If the list of column headings that appears doesn’t include the one you want, click the More option at the bottom of the list. As Figure 9-4 shows, the Choose Details dialog that appears next provides you with a wealth of choices—more than 300 if you scroll through the entire list.
Figure 9-4 Use this exhaustive list to customize which headings are displayed in Details view.
In the Choose Details dialog, column headings that are currently visible appear at the top of the list. Use the Move Up and Move Down buttons to change the order in which headings appear. (You can also change the column order in File Explorer by dragging headings with the mouse.)
Initially, all folders intended for the storage of user data (including those you create) are assigned one of five folder templates that define the default headings File Explorer considers appropriate for the content type. The logic is straightforward: You probably want to sort a folder full of MP3 tracks by track number, and the Date Taken column is extremely useful for filtering digital photos, but neither column would be particularly useful in a folder full of Microsoft Word documents.
The final option on the View menu, Show, leads to a submenu with six additional elements of the File Explorer interface that you can show or hide. Every item on the Show menu is a toggle, allowing you to quickly show or hide file name extensions and item checkboxes, for example. The Details Pane and Preview Pane options appear to the right of the contents pane, showing either details about the current file (a topic we discuss in the next section) or a preview of the currently selected file. File formats supported in the preview pane include most image files, Microsoft Office documents, and PDF files. Click once to make the pane visible; click again to hide the pane. If you use either capability regularly, it’s worth memorizing the keyboard shortcuts: Alt+P for Preview, Alt+Shift+P for Details.
Every file you view in File Explorer has a handful of properties that describe the file itself: the file name and file name extension (which is associated with the app that opens that type of file), the file’s size, the date and time it was created and last modified, and any file system attributes. These properties are stored in the file system and are central to displaying the contents of a folder or other location and performing simple searches.
In addition to these basic file properties, many data-file formats can store custom metadata. These additional properties can be added by a device or by software; in some cases, the user can modify them. When you take a digital picture, your camera or smartphone might add the device make and model, exposure time, ISO speed, and other details to the file when it’s saved. When you buy a digital music track or album, the individual audio files include custom properties (often referred to as tags, from the IDv3 tag format used in MP3 files) that identify the artist, album, track number, and other details. You can also add free-form tags to digital images saved in formats that support that additional metadata. Microsoft Word and other Microsoft Office apps automatically add your name to the Author field in documents you create; you can fill in additional properties such as keywords and comments and save them with the file.
The simplest way to view metadata for a file is to click View on the File Explorer command bar and then click Show > Details Pane. Doing so opens a pane on the right that displays a thumbnail of the selected file (if a thumbnail is available), plus metadata saved as file properties. You can click through a group of files in rapid succession, with the contents of the details pane changing with each new selection. Figure 9-5 shows these details for a photo saved in JPEG format; saved file properties include the date and time the photo was taken, the make and model of the camera (in this case, the camera is a smartphone), the dimensions of the picture, the exposure settings, and many more details.
Figure 9-5 The Details Pane in File Explorer shows a selection of properties from the currently selected file. Some are directly editable; others are fixed and can’t be changed.
Saving custom information as metadata can make it easier to find that file (and others like it) using the search tools we describe later in this chapter.
The properties displayed in the details pane are an excellent starting point, but they might not represent every detail available for the selected file. To see the complete list, right-click the item and click Properties (or select the item and press Alt+Enter). Then click the Details tab in the properties dialog.
Figure 9-6 shows a side-by-side comparison of the Properties dialog and the details pane for a music track. A casual listener might not care that scrolling down through the Properties dialog reveals such exotica as Mood, Beats-Per-Minute, and Initial Key, but a professional DJ can certainly find uses for those extra details.
Figure 9-6 The Details tab in a file’s Properties dialog (left) offers a more exhaustive set of editable properties than the simpler details pane (right).
In either place, the details pane or the Properties dialog, you can edit many (but not all) of the item’s properties. Some properties, such as file size, photo dimensions, and MP3 bitrate, are calculated by the file system or are otherwise fixed and cannot be directly modified. But you can edit custom metadata if the format of the underlying file allows you to do so.
To enter or change a property’s value, click the field name and type in the box containing its value. If you add two or more words or phrases to a field that accepts multiple entries (such as Tags, Composers, or Authors), use semicolons to separate them. Press Enter or click Save to add the new or changed properties to the file.
You can edit properties for multiple files at one time. This is especially useful when you’re correcting an error in an album or artist name; just select all the songs in the album’s folder. When more than one file is selected, note that some properties in the details pane (such as track numbers and song titles) change to indicate that the specified field contains multiple values. A change you make to any field is written to all the files in your selection.
Metadata is saved within the file itself, using industry-standard data storage formats. Software developers who need to create a custom file format can make its metadata available to Windows by using an add-in called a property handler, which opens the file format to read and write its properties. Because metadata is saved within the file itself, the properties you edit in File Explorer or a Windows program are fully portable. This opens some useful possibilities:
You can move files to other computers, even those running other operating systems, without losing the files’ tags and other metadata.
You can edit a file in an app other than the one in which it was created without losing any of the file’s properties (assuming the other app properly adheres to the file format’s standard for reading and writing metadata).
A file’s properties are visible to anyone who has read access to the file.
You can edit custom properties only in files saved using a format that accommodates embedded metadata. For digital image files, Windows supports the JPEG, GIF, and TIFF formats, but you cannot save metadata in bitmap images and graphics files saved in PNG format, because these formats were not developed with metadata in mind. Among music file formats, MP3, WMA, and FLAC fully support a wide range of properties designed to make it easy to manage a music collection; files saved in the uncompressed WAV (.wav) format do not support any custom tags. Plain text and Rich Text Format (.rtf) files do not support custom metadata; files saved in Word formats expose a rich set of additional properties, as do all other native file formats from Microsoft Office programs.
In some cases, you’re unable to view or edit metadata in a file even though the underlying format supports metadata. In that case, the culprit is a missing property handler.
Depending on the file type, you can dramatically reduce the amount of disk space used by one or more files by compressing those files into a zipped folder. You can also combine multiple files into a single Zip file while preserving the folder hierarchy of that group of files, making it easier to store multiple files or send them to another person as an email attachment.
Don’t be fooled by the name: A zipped folder (also known as a Zip file or archive) is actually a single file, compressed using the industry-standard Zip format and saved with the .zip file name extension. Any version of Windows can open a file saved in this format, as can other modern operating systems. The format is also accessible with the help of many third-party utilities.
To create a new archive using zipped folders, follow these steps:
In File Explorer, display the folder in which you want the new archive to reside.
Right-click any empty space in the folder, and then click New > Compressed (Zipped) Folder.
Enter a new, descriptive name in place of the highlighted default name and press Enter.
To add files and folders to your archive, drag and drop them onto the zipped folder icon in File Explorer (or double-click to open the zipped folder in its own window and then drag items into it). You can also use the Clipboard to copy and paste items. To remove an item from the zipped folder, double-click the folder to display its contents, right-click the item, and then click Delete.
You can also create a compressed folder from the current selection in File Explorer by right-clicking any selected file or folder and clicking Compress To Zip File. Windows creates an archive file with the same name as the selected object. If you’re compressing a single file, that default name might be acceptable. If you’re compressing a group of files and/or folders, replace it with a more descriptive one.
To extract individual files or folders from a zipped folder, open it in File Explorer and then drag the items you want to extract to a new location, or use the Clipboard to copy and paste. To extract all items from a zipped folder to a specific location, right-click the zipped folder icon and then click Extract All, or open the zipped folder in File Explorer and click Extract All on the command bar.
Windows uses a logical organizational structure that helps keep data together in known system folders. As we explain in this section, you can change the location of some of these folders to make best use of your available storage. You can also create virtual storage locations called libraries to make searching easier.
Your personal files and settings are stored by default in your user profile, which is created by copying the contents of the Default profile to a new folder when you sign in to a user account for the first time on a device. In addition to predefined folders for personal documents and digital media files, this new profile also includes the details that define the desktop environment: the user’s own registry settings (HKEY_CURRENT_USER), as well as user data and settings for installed apps and desktop programs.
Note
Although you can customize the Default profile, doing so requires the use of enterprise deployment tools and is impractical for home and small business installations.
In addition to individual user profiles, Windows 11 creates a Public profile containing a group of folders for common document types that mirror those in your user profile. You can see the Public Documents, Public Music, Public Pictures, and Public Videos folders in their matching libraries. The advantage of these folders is that other users can save files to these locations from different user accounts on the same computer or from across the network.
Local user profiles are stored in %SystemDrive%\Users. (On most Windows 11 PCs, this address is equivalent to C:\Users.) Each user’s profile is stored in a subfolder whose name is based on the user account name (for example, C:\Users\Katy). The entire path for the current user’s profile is accessible via another commonly used environment variable, %UserProfile%. If you have File Explorer’s navigation pane set to show all folders, you can see the subfolders of your profile by clicking your username in the navigation pane. (To turn this navigation pane option on or off, right-click a blank space in the pane and select or clear the Show All Folders menu option.)
To see the folders included in your user profile, open its folder directly from C:\Users or from the drop-down menu at the left of the address bar. As you can see from Figure 9-8, the list includes some familiar destinations. (Because third-party apps can add their own data folders to the user profile, your system might include some additional folders.)
Figure 9-8 Each user profile contains folders intended for specific types of data as well as a hidden AppData folder for data that should be accessed only from within an app.
The personal data folders (Documents, Downloads, Music, Pictures, and Videos) serve as the default location for applications that use those file types. You’ll also find folders containing the contents of synced OneDrive and SharePoint data stores. Here’s everything you need to know about the remaining folders:
3D Objects This system folder made its first appearance in Windows 10. It’s used for storing data files created by apps like Paint 3D that are no longer included with Windows 11.
Contacts This folder first appeared in Windows Vista and was designed to store contact information used by Windows Mail. It is not used by any programs included in Windows 10 or Windows 11 and is maintained for compatibility purposes with older third-party personal information management programs.
Desktop This folder contains items that appear on the user’s desktop, including files and shortcuts. (A Public counterpart also contributes items to the desktop.) A link to this location appears in the Quick Access section of the navigation pane.
Favorites Internet Explorer saves shortcuts to websites here. As we note in Chapter 7, Microsoft Edge handles its favorites collection differently, and because the Internet Explorer app is no longer accessible from Windows 11, the contents of this folder are not used.
Links In Windows 7, this folder contains shortcuts that appear in the Favorites list at the top of the navigation pane. Its contents are not used in Windows 11.
Saved Games This folder is the default storage location for apps that can save a game in progress.
Searches This folder stores saved search specifications, allowing you to reuse previous searches. (We explain how to use this feature later in this chapter.)
The organizational scheme that Windows uses for personal data folders—keeping documents, music, pictures, and so on in visible subfolders of %UserProfile%—is perfectly appropriate for most configurations. In fact, for portable devices and all-in-one PCs that have only a single storage device, it’s the only option.
On PCs that include options for multiple storage devices, some users prefer to store documents and other personal data on a volume other than the one that contains system files. With this configuration, it’s easier to organize large collections of data; that’s especially true of digital media files, which have a way of overwhelming available space on system volumes. (It’s a good idea to keep a portion of your system drive free for maintenance, such as updates, and for performance, which reduces available data storage even further.)
This option is especially attractive on desktop PCs where Windows is installed on a solid-state drive (SSD) to maximize performance. Adding a second, much larger conventional hard disk—at a cost per gigabyte that’s typically a fraction of an SSD—makes it possible to store large amounts of data without compromising system performance.
The easiest, safest way to accomplish this goal is to store personal data in folders on a separate drive, and then include those folders in your libraries and set them as the default save location, a topic we cover in the next section. This approach leaves you with a default set of profile folders, which you can still use when it’s convenient to do so, but it keeps the bulk of your data files on a separate drive.
Not everyone loves libraries, however, and there’s no requirement to love them. You can still move some or all of your profile subfolders in Windows 11, just as you could in earlier versions. (In fact, this is the exact technique Microsoft uses with the OneDrive Backup feature, which we describe in Chapter 8.) To relocate a user profile folder by editing its properties, follow these steps:
Open your user profile folder by starting at This PC, navigating to C:\Users, and then double-clicking your profile name. Alternatively, enter %UserProfile% in the address bar.
Right-click a folder you want to relocate and choose Properties. (Or select the folder, and then click Properties on the Home tab.)
On the Location tab, enter the address you want to relocate the folder to. For example, to move the Videos folder from its default location in the user profile on drive C to D:\Videos, type or paste the path as shown in Figure 9-9.
Figure 9-9 Use this dialog to change the location of system folders.
Click OK. Windows asks permission to create the target folder if it doesn’t already exist. Click Yes. A Move Folder dialog similar to the one shown in Figure 9-10 appears.
Figure 9-10 When moving the default location for a user profile folder to a new drive, it’s wise to move its files as well.
Unless you have some good reason not to move the existing files from the original location to the new one, click Yes.
It’s really not a good idea to click No in this dialog. First, it’s difficult to imagine why you would want to divide your personal documents into two identically named folders on different volumes. (If you want to keep your existing files separate from those you save in the future, move the old files to a subfolder in the new location instead of leaving them in the old location.) Second, because %UserProfile% is a system-generated folder, not an ordinary data folder that corresponds to a fixed disk location, leaving some files behind gives you two subfolders with the same name in %UserProfile%.
A library is a virtual folder that aggregates the contents of multiple folders stored on your computer, on your network, or in the cloud. You can sort, filter, group, search, arrange, and share the data in a library as if it were in a single location. Windows 11 gives you several by default: Documents, Music, Pictures, and Videos, with Saved Pictures and Camera Roll libraries also available. You can create additional libraries to suit your storage needs, and you can customize any library by changing or adding to the physical folders that make up that library.
The important things to understand about libraries are the following:
A library can encompass multiple folders on multiple disks on multiple networked devices.
All folders in a library must be capable of being indexed, which in turn means you can perform fast searches covering the full contents of a library by entering a search term in the search box while viewing the contents of a library in File Explorer. That action quickly pulls up all matching documents, even if they’re located on a networked PC or server or on an external drive. (It also means that you cannot add a shared folder to a library if it’s located on a network-attached storage device that doesn’t support Windows indexing.)
Library files are automatically backed up by File History, but only if you’ve enabled this feature.
Libraries are useful for large collections of digital media files, where archived files are stored in a shared network folder or on an external drive, with current projects on a local drive. They’re also invaluable for keeping projects organized—create a separate library for each project that includes your local project folder and the shared folders where you and your coworkers store templates, graphics, and submissions from outside contributors.
To create a new library, right-click the Libraries heading in the navigation pane, click Show More Options, and then click New > Library. (If you don’t see the Libraries heading, right-click in an empty space in the navigation pane and then click Show Libraries.) Give the new library a descriptive name and then press Enter. Your newly created library appears in the navigation pane. Open it and then click the Include A Folder button to populate the library.
Using the Include Folder In dialog, select the folder you want to use as the default location for saving files in this library, and then click Include Folder. That opens the library and lists the contents of the folder you just selected.
To add more folders to the library, right-click the library name in File Explorer’s navigation pane and then click Properties. That opens a dialog like the one shown in Figure 9-11, where you can manage the library’s locations.
Figure 9-11 The first folder you add to a library becomes the default location for saving files within that library. Use this dialog to add more folders and change settings.
In this dialog, you can remove folders as well as add them, of course, and you can change the library’s default save folder. The default save folder is important for applications that expect to save their documents in particular places—a music service, for example, that expects to save downloaded songs in a certain folder within the Music library. It’s also the folder that File Explorer will use if you drag a file to the library’s heading in the navigation pane.
To delete a library, right-click its entry in the navigation pane and click Delete. Doing so removes the library, but its component folders and their contents remain.
As we explain in Chapter 8, every Microsoft account includes a generous allotment of free, cloud-based file storage from OneDrive. If you have a paid Microsoft 365 subscription, that allotment goes up to a full terabyte of storage. You can connect one and only one Microsoft account to Windows to access the consumer version of OneDrive in File Explorer, but you’re able to connect one or more Azure AD accounts for access to multiple OneDrive for Business storage allocations.
To view the contents of any OneDrive or OneDrive for Business account in File Explorer, click its node in the navigation pane. By default, the Files On-Demand feature is enabled, which means File Explorer shows all the files and folders stored in that account. The files themselves are available on demand, but they’re not actually downloaded until they’re needed. Depending on the size of the file, that might cause a brief delay between the time you double-click a file and when it opens in the associated app. That trade-off is worth it, though, knowing you can have ready access to hundreds of gigabytes of cloud-based files even on a device that has only a fraction of that space available for data storage.
With Files On-Demand enabled, a green badge alongside each file or folder displays its availability status. Figure 9-12 shows the three status icons you’ll see.
Figure 9-12 These badges alongside each file and folder indicate its current status. Online-only files take up no local disk space but can be downloaded on demand.
Items that are currently being synced (or are pending sync, because you have them open) are denoted by rotating arrows.
On a device with sufficient storage, you can sync your entire cloud file collection; just make sure there’s enough disk space to handle all the photos, music files, video clips, and documents stored there. On devices that have limited local storage, you can selectively sync folders in the cloud to the local device so that those files are available even when you’re offline.
By default, all files and folders are marked initially as Available When Online. Their status changes to Available On This Device after you double-click an item to download it. If you want one or more individual files or folders to be available at all times, right-click the item and choose Always Keep On This Device. Note that if you choose this option for a folder, any new files you save in that folder are automatically marked as Always Available On This Device.
With Files On-Demand enabled, you can selectively show or hide files and folders in File Explorer. Open the OneDrive Settings dialog for the account you want to adjust, click the Account tab, and then click Choose Folders. By default, all folders and all files are selected. From the list of folders, as shown in Figure 9-13, clear the checkbox for any you want to keep online without displaying in File Explorer.
Figure 9-13 Clear the Make All Files Available checkbox if you prefer not to see the contents of some OneDrive folders in File Explorer.
You can disable the Files On-Demand feature if you prefer; in that configuration, only files and folders you choose to sync from the cloud to the local device are visible in File Explorer. To find this setting, select the OneDrive or OneDrive for Business icon in the navigation pane, just below Home. Then click the OneDrive icon in the upper-right corner of File Explorer, just above the details pane, to open the sync status menu. Finally, click the gear icon to open OneDrive Settings; on the Sync And Backup tab, click the down arrow to the right of Advanced Settings to display its options, and then turn the Files On-Demand switch to the Off position.
Any file or folder you save in your local OneDrive or OneDrive for Business folder is automatically copied to a corresponding location in the cloud. If you have multiple devices (including PCs, Macs, tablets, and mobile phones) using the same OneDrive or OneDrive for Business account, changes, additions, and deletions you make to files and subfolders on one device are synchronized with all those other devices. So, for example, if you routinely work on the same documents on separate computers at the office and at home, saving to the OneDrive folder on each system ensures that you can retrieve the latest version from anywhere.
If you need to interrupt this normal syncing activity, right-click the OneDrive or OneDrive for Business icon in your notification area, click the gear icon, and choose Pause Syncing. You can pause for two hours, eight hours, or a complete day.
You can get a quick overview of OneDrive sync status (as well as how much of your available storage you’ve used) by clicking the cloud icon in the top-right corner of the File Explorer window for the OneDrive or OneDrive for Business account. Get detailed information about a sync operation in progress by clicking the OneDrive icon in your notification area, as shown in Figure 9-14.
Figure 9-14 Click the cloud icon in the notification area (white for personal, blue for a OneDrive for Business account) to display this sync status window.
The gear icon at the top of the status window opens a menu that includes a link to OneDrive Settings. The three icons in the navigation bar along the bottom of this status display are live. Click Open Folder to open the corresponding OneDrive or OneDrive for Business folder in File Explorer. Click View Online to open the OneDrive account in a browser window. Click Recycle Bin to open a browser window that shows files and folders you’ve deleted but are available for recovery.
To share a file or folder in your personal OneDrive, right-click the item in File Explorer and then click OneDrive > Share. A Share dialog like the one in Figure 9-15 appears.
Figure 9-15 You can share any file or folder with another person using these controls or create a link that anyone can use to open that file or folder.
As Figure 9-15 shows, the share is initially set to offer full editing privileges to any recipient. Click the right-pointing arrow to reveal additional settings, including an Allow Editing checkbox that you can clear to make a shared file read-only. You can also assign a password and an expiration date to the share.
Enter an email address to share the link with a specific person, or click the Copy Link button, which copies the sharing link to the Clipboard so that you can paste it into a message yourself. Sharing options and procedures are similar in OneDrive for Business. Right-click a OneDrive for Business item in File Explorer and click Share. This opens the same Send Link dialog as in OneDrive Personal; click the arrow to the right of the link to see additional settings, such as an option to allow sharing only by members of your organization. Note that options to share outside your organization might be restricted by your administrator. You can also assign read-only or edit permissions and choose various other options.
It takes only a fraction of a second to wipe out a week’s worth of work. You might accidentally delete a folder full of files or, worse, overwrite an entire group of files with changes that can’t be undone. Whatever the cause of your misfortune, Windows includes tools that offer hope for recovery. If a file is simply lost, try searching for it. (See “Searching from File Explorer” later in this chapter.) For accidental deletions, your first stop should be the Recycle Bin, a Windows institution since 1995.
Note
Like its predecessors, Windows 11 includes an alternative backup and recovery tool called File History. In Windows 11, Microsoft has removed the configuration options for this feature from the Settings app; to enable and use File History, you have to use a well-hidden option from the legacy Control Panel, as we describe in Chapter 15, “Troubleshooting, backup, and recovery.” In Windows 11, the preferred method for protecting important data files is syncing them to OneDrive, which offers a Recycle Bin of its own, along with robust version history features that make it possible to recover from a simple accidental deletion or even from a ransomware attack.
The Recycle Bin provides protection against accidental erasure of files. In most cases, when you delete one or more files or folders, the deleted items go to the Recycle Bin, not into the ether. If you change your mind, you can go to the bin and recover the thrown-out items. Eventually, when the bin fills up, Windows begins emptying it, permanently deleting the files that have been there the longest.
The following kinds of deletions do not go to the Recycle Bin:
Files stored on removable storage devices, such as USB flash drives
Files stored on network drives, even when that volume is on a computer that has its own Recycle Bin
Files deleted from a command prompt
Files deleted from compressed (zipped) folders
You can bypass the Recycle Bin yourself, permanently deleting an item, by holding down the Shift key while you delete the item. You might choose to do this if you’re trying to reclaim disk space by permanently getting rid of large files and folder subtrees.
The root of each fixed drive on a Windows 11 PC has its own hidden $Recycle.Bin folder, which contains deleted files for all user accounts and whose contents are not accessible except through the virtual view afforded by the Recycle Bin shortcut. Windows ordinarily allocates up to 10 percent of each fixed disk’s space for use by the Recycle Bin. To see and adjust the amount of space currently allocated to the Recycle Bin for each drive that it protects, right-click the Recycle Bin icon on your desktop and then click Properties. In the Recycle Bin Properties dialog (shown in Figure 9-16), you can select a drive and enter a different value in the Custom Size box. (When the bin is full, the oldest items give way to the newest.)
Figure 9-16 Use this dialog to fine-tune the amount of space the Recycle Bin is allowed to use—or to turn the feature off completely for selected drives.
(Note that this dialog doesn’t show the amount of space currently being used by the Recycle Bin on a per-drive basis. To find those details, you need to go to Settings > System > Storage, as we describe in “Managing disk space,” in Chapter 8.)
If you think that amount of space is excessive, enter a lower value. If you’re certain you don’t need to recover files from a particular drive, select the Don’t Move Files To The Recycle Bin setting for that drive.
Windows normally moves files to the Recycle Bin silently when you delete them. If you’d prefer to see a confirmation prompt every time you delete a file or folder, select the Display Delete Confirmation Dialog checkbox.
Opening the Recycle Bin in File Explorer displays a virtual view that contains the names and other essential details of all recently deleted items from the current user profile. In Details view, you can see when each item was deleted and which folder it was deleted from. Use the column headings to sort the folder—for example, to display items that have been deleted most recently at the top, with earlier deletions below. Alternatively, you can organize the bin by disk and folder by clicking the Original Location heading. If these methods don’t help you find what you’re hoping to restore, use the search box.
Note that deleted folders are shown only as folders; you don’t see the names of items contained within the folders. If you restore a deleted folder, however, Windows re-creates the folder and its contents.
The Restore commands on the File Explorer command bar (Restore All Items and Restore The Selected Items) put items back in the folders from which they were deleted. If a folder doesn’t currently exist, Windows asks your permission to re-create it. Note that if your Recycle Bin contains hundreds or thousands of deleted files dating back weeks or months, Restore All Items can create chaos. That command is most useful if you recently emptied the Recycle Bin and all of its current contents are visible.
If you want, you can restore a file or folder to a different location. Drag the item out of the Recycle Bin and drop it in the folder where you want to save it. To create a compressed backup copy of one or more items in the Recycle Bin, make a selection, right-click, and then choose Compress To Zip File from the shortcut menu.
A deleted file sitting in your Recycle Bin takes up as much space as it did before it was deleted. If you’re deleting files to free up space for new programs and documents, transferring them to the Recycle Bin doesn’t help. You need to remove them permanently. The safest way to do this is to move the items to another storage medium—a different hard disk or a removable disk, for example.
If you’re sure you’ll never need a particular file again, however, you can delete it in the normal way, and then purge it from the Recycle Bin. Display the Recycle Bin, select the item, and then press Delete.
To empty the Recycle Bin entirely, click Empty Recycle Bin on the File Explorer menu bar.
Regardless of the view settings you’ve chosen for a folder, you can adjust the way its contents are displayed at any time by changing the sort order, filtering the contents by one or more properties to include only selected items, and grouping and arranging the contents by a particular heading. In any view, the sort and group options are available by right-clicking anywhere in the contents pane and choosing a Sort By or Group By option. In most cases, however, these actions are easier to accomplish by switching to Details view and using the column headings; that’s also the preferred way to filter.
Note that all these techniques also work with virtual folders, such as search results and libraries.
To sort a folder in Details view, click the heading you want to use as a sort key. For example, to sort by Date Modified, click the Date Modified heading. Click again on the same heading to reverse the sort order. An up arrow or down arrow above the heading indicates whether the folder is sorted in ascending or descending order by that field.
In all other views, right-click any empty space in the contents pane and select a value from the Sort By menu. A bullet next to Ascending or Descending indicates the current sort order; choose the other option to reverse the sort order.
In Details view only, you can use headings to filter the contents of a folder. If you rest your pointer on a heading, a drop-down arrow appears at the right. Clicking the arrow reveals a set of filter checkboxes appropriate for that heading. In most cases, the filter list is built on the fly from the contents of the current file list. If you’re looking for a particular type of file—a Word or PDF document, for example, or an executable file—you can filter by type to show only those files. Figure 9-17 shows the filter list for the Type field in the Downloads folder, with the contents filtered to show only files whose type matches Application.
Figure 9-17 When you click the drop-down arrow to the right of a column heading, a set of filtering options appropriate for that heading appears.
Select the checkbox next to any item to add it to the filter list; clear the checkbox to remove a previously selected item from the filter. After you filter the list in Details view, you can switch to any other view and the filter persists. Look in the address bar to see the specific filter applied and then click the folder name to the left of the search term in the address bar (also known as a breadcrumb) to remove all filtering without switching back to Details view.
If you filter by Size or Name, you get a much more limited set of choices that includes ranges rather than discrete values.
A single filter can include multiple items from each heading’s filter list, which are treated as a logical OR—in other words, File Explorer displays items that match any of the selected checkboxes. A filter can also include multiple headings, which together function as a logical AND, with File Explorer displaying only items that satisfy the criteria applied to each heading. So, for example, you can filter a picture folder to show only photos where the value in the Rating column is four or five stars and the value in the Date Taken field is in this year, resulting in a list of your favorite photos of the year, suitable for a year-end newsletter or family photo album.
When a folder is filtered, check marks appear to the right of headings used for filtering. The values on which you have filtered appear in the address bar. You can perform most common file-management tasks on the items in the results list, including renaming individual files or using the Clipboard to copy or move files from their current location to a new folder.
If sorting and filtering don’t give you enough ways to organize or locate files, try grouping. When you group items, File Explorer collects all the items that have some common property, displaying each group under a heading that can be expanded or collapsed in most views.
List view offers a particularly interesting perspective, with each group of results appearing under a column heading. The grouped arrangement is saved as part of the custom view settings for that folder; the next time you open the folder, it will still be grouped.
To group items in a File Explorer window, open the View tab, click Group By, and then click the property you want to use. File Explorer displays a bullet before the selected property. You can remove the grouping by returning to Group By and choosing None.
The search capabilities in Windows 11 are direct descendants of standalone tools and Windows features that date back to the turn of the 21st century. Those original search tools relied on something called Advanced Query Syntax (AQS), which survives, only slightly modified, in a mostly undocumented form today.
Windows 11 thoroughly hides most signs of AQS when you build a search using the Search Options menu. If you master the advanced query syntax, you can create your own searches and even save them for reuse, as we explain later in this section. But we start with the simplest of searches.
To use File Explorer’s search tools, start by selecting a folder, a library, or a OneDrive account. That defines the scope of your search—the set of files from which you want to draw search results. (If you’re not sure which folder contains the files you’re looking for, choose Home from the navigation pane.)
Next, click in the search box in the upper-right corner of the File Explorer window. Start typing a word or phrase in the search box. As you type, File Explorer displays an abbreviated list of files and folders whose name, properties, or contents match that search term. Press Enter or click the arrow to the right of the search box, and your search results appear. At the same time, File Explorer adds a Search Options menu to the command bar; click it to display the additional options shown in Figure 9-18.
Figure 9-18 Start a search by entering a search term or search operator in the search box; then click the Search Options menu to refine the search.
The following rules govern how searches work:
Whatever text you type as a search term must appear at the beginning of a word, not in the middle. Thus, entering des returns items containing the words desire, destination, and destroy but not undesirable or saddest. (You can override this behavior by using wildcard characters, as we explain in “Advanced search tools and techniques” later in this chapter.)
Search terms are not case sensitive. Thus, entering Bott returns items with Ed Bott as a tag or property, but the results also include files containing the words bottom and bottle.
By default, searches ignore accents, umlauts, and other diacritical marks. If you routinely need to be able to distinguish, say, Händel from Handel, click Search Options > Change Indexed Locations to open the Indexing Options dialog, click Advanced (for which you need administrative credentials), and then select Treat Similar Words With Diacritics As Different Words.
To search for an exact phrase, enclose the phrase within quotation marks. If you enter two or more words without using quotes, the search results list includes items that contain all of the words individually.
Search results for indexed folders appear so quickly that you might have a substantial number of results before you type the second or third character in the search string. A complicating factor: If your search term is part of a subfolder name, your results list includes the entire contents of that subfolder.
If simply entering a search term doesn’t return the needed results, you have two options. The easiest is to build a new search (or refine the current one) using the point-and-click commands on the Search Options menu. The other is to use the powerful but cryptic search syntax to build a search manually.
The Search Options menu offers a wealth of options to create and refine a search. The choices you make here return results from the current search scope. By default, All Subfolders is selected on the Search Options menu. Click Current Folder to constrain results so that the contents of subfolders are not included.
Three filters get top billing on the Search Options menu:
Date Modified This property represents the most recent date a file or folder was saved. For a downloaded program file, it shows the date you saved the file locally, not the date the developer created it.
Kind This field shows predefined groups of file types, including those for some items that aren’t stored in File Explorer. The most common choice to make here is Document, which includes text files, any file saved in a Microsoft Office format, and PDF files. Try Music, Movie, or Picture if you’re looking for digital media files.
Size This list shows a range of sizes. If you’re trying to clear space on your system drive, choosing Huge (1 – 4 GB) or Gigantic (>4 GB) is a good way to locate large files that can safely be deleted or archived on an external drive.
Any of those filters can help find a specific file. For example, if you’re looking for an invoice you’re certain was created last month, click Search Options > Date Modified and then select Last Month. If the set of results is still too large to scan, you can use additional choices on the Search Options menu to refine the search, or click in the search box and enter a word or phrase that you know was in the file’s name or its contents.
You can also use search operators, followed by a colon, to restrict search results. For a folder optimized for General Items, the following four operators are useful:
Type Enter a file extension (pdf, xls, or docx, for example) or any part of the description in the Type field in Details view; enter Excel, for example, to return Excel workbooks in any format.
Name Enter a string of text here. The results list shows any file or folder that contains that exact string at the beginning of any word in its name.
Folder Path Enter a string of text here. The results list shows any file or folder that contains that exact string anywhere in its full path. If you enter doc, the results include all files and folders in your Documents folder and any of its subfolders (because Documents is part of the path for those subfolders), as well as the contents of any other folder whose name contains a word beginning with those three letters.
Tags Almost every data file contains this field, which is stored as metadata in the file itself. You can add one or more tags to any file using the Details pane or the Details tab in its properties dialog.
The list of available options changes slightly for other folder types. Documents folders include Authors and Title operators, and Photos folders include Date Taken and Rating, for example.
To run the same search from a different location, click Search Again In and choose an available scope. Or just switch to a different node in the navigation pane and start again.
At its heart, the Windows Search service relies on a speedy, powerful, and well-behaved indexing service that does a fine job of keeping track of files and folders by name, by properties, and (in supported formats) by contents. All those details are kept in the search index, a database that keeps track of indexed file names, properties, and the contents of files. As a rule, when you do most common types of searches, Windows checks the index first and returns whatever results it finds there.
Note
The search index is stored by default in %ProgramData%\Microsoft\Search\Data. Default permissions for this folder are set to allow access only to the System account and to members of the Administrators group. You can change its location using the Indexing Options dialog (available by searching from the taskbar or Control Panel). We can’t, however, think of a good reason to do so. This folder contains no user-editable files, and we recommend that you leave it in its default location with its contents undisturbed.
To build the index that makes its magic possible, Windows Search uses several separate processes. The index is constructed dynamically by the Windows Search service, SearchIndexer.exe. It includes metadata for all files in all locations that are prescribed to be indexed; for documents in formats that support indexing of file contents, the indexer extracts the text of the files and stores it alongside the file properties for quick retrieval.
The Windows Search service begins running shortly after you start a new Windows session. From that point on, it runs in the background at all times, creating the initial index and updating it as new files are added and existing ones are changed or deleted. Protocol handlers do the work of opening different data stores to add items to the index. Property handlers allow Windows Search to extract the values of properties from items and store them properly in the index. Filters extract the contents of supported file types so that you can do full-text searches for those items.
The Search service does its best to minimize the effect of its activities on the performance of your system. The indexing process steps back or stops when the system perceives peak disk usage and under these other conditions:
When gaming mode is on
When power savings or a low power mode is on
When your system switches from AC to DC or your battery charge is less than 50 percent
When CPU usage goes above 80 percent or disk usage above 70 percent
In addition, the indexing algorithm in Windows 11 is designed to detect high disk usage and manage the indexer so that it doesn’t negatively affect performance.
Indexing every 0 and 1 on your hard disk would be a time-consuming and space-consuming task—and ultimately pointless. When you search for a snippet of text, you’re almost always looking for something you wrote, copied, or saved, and you don’t want the results to include random program files that happen to have the same snippet embedded in the midst of a blob of code. (Yes, we know some developers might disagree, but they’re the exception, and developer tools are the preferred method of dealing with those exceptions.) So the default settings for the indexer make some reasonable inclusions and exclusions.
Certain locations are specifically included. These include all user profiles (but not the AppData folder), the contents of the Start menu, and, if Microsoft 365 is installed, your OneNote and Outlook data. Locally synced files from OneDrive are automatically included in your local index. You can explicitly add other folders to the index, but Windows 11 eliminates the need to do that. Instead, just right-click the folder, click Include In Library, and select an existing library or create a new one; when you do so, Windows automatically adds that folder to the list of indexed locations and begins indexing its contents without requiring additional steps on your part.
If you understand the potential impact on performance and still want to extend Windows Search to include more folders than the default, go to Settings > Privacy & Security > Searching Windows and change the Find My Files option from Classic to Enhanced. This option changes the behavior of search, returning results from across all folders and drives, including your desktop.
To see which folders are currently being indexed, open the Indexing Options dialog. You can get there in various ways, including by typing Indexing Options in the search box on the taskbar.
Caution
We strongly recommend that you not try to manage locations manually using the Indexed Locations dialog. If you add a folder to a library and then remove it from the list of indexed locations, the folder remains in the navigation pane under the associated library, but none of its contents will be visible in the library itself.
Within that list of indexed locations, the Windows Search service records the file name and properties (size, date modified, and so on) of any file or folder. Files marked as System and Hidden are indexed but are displayed in search results only when you change File Explorer settings to show those file types. Metadata for common music, image, and video file formats is included in the index by default. The indexer also includes the contents of a file and its custom properties if the file format has an associated property handler and filter, as is the case with most popular document formats.
To see whether a particular file format supports content indexing, open the Indexing Options dialog, click Advanced, and then click the File Types tab. Find the extension associated with the file type and then look in the Filter Description column for the name of the filter that handles that extension. If you see File Properties Filter, the file type does not support content indexing. File types that are supported have a named filter, such as Microsoft Office Filter, Open Document Format ODT Filter, HTML Filter, or Reader Search Handler.
The list of formats on the File Types tab on your computer might include more file types if you installed Windows programs that include custom property handlers and filters, such as the Office Open XML Format Word Filter installed with Microsoft 365.
Windows Search does not index the content of files that are saved without a file name extension, nor does it index the contents of files that are protected by Information Rights Management (IRM) or digital rights management (DRM).
A handful of locations are specifically excluded from indexing. Even if you manually specify that you want your system drive (normally C) to be included in the index, the following files and folders will be excluded:
The entire contents of the \Windows folder and all its subfolders. The Windows.old folder that’s created by an upgrade installation of Windows 10 is also excluded.
\$Recycle.Bin (the hidden folder that contains deleted files for all user accounts).
\Users\Default and all of its subfolders. This is the user profile template used to create a profile for a new user.
The entire contents of the \Program Files and \Program Files (x86) folders and all their subfolders.
The \ProgramData folder (except the subfolder that contains shortcuts for the shared Start menu).
The status message at the top of the Indexing Options dialog offers real-time updates on what the indexer is doing at the moment. “Indexing complete” means there are no pending tasks. The status message lists the number of items (files, folders, and so on) that are currently in the index.
“Indexing paused” means the service has temporarily stopped all indexing tasks; you see this message if you check the indexer status shortly after you start the computer because the default setting for the Windows Search service is Automatic (Delayed Start).
If indexing tasks are currently underway, the status message displays an increase or decrease in the number of items indexed as new, changed, and deleted files are processed. The indexer is designed to throttle itself whenever it detects that the system is working on other, presumably more important tasks. As a result, you’ll most likely be told that “Indexing speed is reduced due to user activity” when you first check.
That message indicates the indexing service has backed off in response to your activity and is operating at a fraction of its normal speed. If the number of files to be indexed is big enough (if you copied a folder with several thousand documents, for instance), you see the indexing speed pick up dramatically after you keep your hands off the keyboard and mouse for a minute or so.
The exact speed of indexing depends on various factors, including the speed of your CPU and storage subsystem, as well as the number, size, and complexity of documents and whether their full contents are being indexed. Unfortunately, the status message in the Indexing Options dialog doesn’t include a progress bar and doesn’t indicate how many files are yet to be indexed, so there’s no easy way to tell whether the current task is barely underway or nearly complete. If you haven’t recently added any new folders to the index but have simply been changing a few files in the course of normal work, the index should stay close to complete (assuming you’ve ever had a complete index).
In the past, some websites for performance-obsessed Windows users complained about the performance hit that Windows Search causes; some even recommended disabling the Windows Search service to improve overall system performance. We recommend you leave it running. In our experience, the Windows Search service uses only a small percentage of available CPU resources even at its busiest. The indexing service is specifically designed to back off when you use your computer for other activities, switching to low-priority input/output (I/O) and allowing foreground I/O tasks, such as opening Start, to execute first. When Windows 11 first builds its index, or if you copy a large number of files to the system at once, indexing can take a long time and cause some spikes in CPU and disk activity, but you shouldn’t notice a significant impact on performance. Some unusual indexing activity might be the result of maintenance activities, which the Search service performs automatically every 100,000 files. The operations typically last less than five minutes.
File Explorer accesses the index directly, so even if the indexer is busy processing new and changed files, it shouldn’t affect the speed of a search operation. In normal operation, retrieving search results from even a very large index should take no more than a few seconds. You might notice a delay in opening a folder that contains a large number of compressed folders, including Zip files and ISO disk images.
The most basic query typically begins with a keyword (or a portion of a word) typed in the search box. Assuming you begin typing in a location that supports indexed searches (the search box in Start or, from File Explorer, your locally synced OneDrive folder, for example), the list of search results includes any item in that location containing any indexed word (in its name or properties or content) that begins with the letters you type. You can then narrow the results list by using additional search parameters.
Note
The advanced search syntax we describe here works in the File Explorer search box but not in searches from Start.
Advanced queries support the following types of search parameters, which can be combined using search operators:
File contents Keywords, phrases, numbers, and text strings
Kinds of items Folders, documents, pictures, music, and so on
Data stores Specific locations in the Windows file system containing indexed items
File properties Size, date, tags, and so on
In every case, these parameters consist of a word that the search query recognizes as a property or other index operator, followed by a colon and the value to search for or exclude. (When Windows Search recognizes a word followed by a colon as a valid property, it turns that operator blue.) You can combine search terms using Boolean operators and parentheses.
The value that immediately follows the colon can take several forms. If you want a loose (partial) match, just type a word or the beginning of a word. Thus, type:Word turns up files of the type Microsoft Word Document, Microsoft Word 97 – 2003 Document, Microsoft Word 97 – 2003 Template, Microsoft Word Macro-Enabled Document, and so on. To specify a strict (exact) match, use an equal sign and, if necessary, quotation marks, as in this example:
type:="Microsoft Word Document"
You can also use Boolean operators (AND, OR, and NOT) and parentheses to combine criteria. If you have fond memories of MS-DOS, you’ll welcome using * and ? as wildcards, and you can dramatically change the behavior of a search by means of the innocuous-looking tilde (~
) character (which forces Windows to perform a strict character search in indexed locations, as discussed later in this section).
Of course, all these techniques become much more useful when you’re able to reuse your carefully crafted search criteria, as we explain in “Saving searches” at the end of this chapter.
To search for files with a particular file name extension, you can simply enter the extension in the search box, substituting your file name extension for ext, like this:
*.ext
(Note that this method of searching does not work for .exe or .msc files.) The results include files that incorporate the extension in their contents as well as in their file names—which might or might not be what you want. You get a more focused search by using the ext: operator, including an asterisk wildcard and a period like this:
ext:*.txt
Note
As with many properties, you have more than one way to specify an exact file name extension. In addition to ext:, you can use fileext:, extension:, or fileextension:.
File name extensions are useful for some searches, but you get even better results using two different search properties: Type and Kind. The Type property limits your search based on the value found in the Type field for a given object. Thus, to look for files saved in any Microsoft Excel format, type this term in the search box:
type:excel
To find any music file saved in MP3 format, type this text in the search box:
type:mp3
To constrain your search to groups of related file types, use the Kind property, in the syntax kind:=value. Enter kind:=doc, for example, to return text files, Microsoft Office documents, Adobe Acrobat documents, HTML and XML files, and other document formats. This search term also accepts folder, pic, picture, music, song, program, and video as values to search for.
You can specify a folder or library location by using folder:, under:, in:, or path:. Thus, folder:documents restricts the scope of the search to your Documents library, and in:videos mackie finds all files in the Videos library that contain Mackie in the file name or any property.
You can search on the basis of any property recognized by the file system. (The list of available properties for files is identical to the ones we discuss in “Layouts, previews, and other ways to arrange files” earlier in this chapter.) To see the whole list of available properties, switch to Details view in File Explorer, right-click any column heading, and then click More. The Choose Details dialog that appears enumerates the available properties.
When you enter text in the search box, Windows searches file names, all properties, and indexed content, returning items where it finds a match with that value. That often generates more search results than you want. To find all documents of which Jean is the author, omitting documents that include the word Jean in their file names or content, you type author:jean in the search box. (To eliminate documents authored by Jeanne, Jeannette, or Jeanelle, add an equal sign and enclose jean in quotation marks: author:=”jean”.)
When searching on the basis of dates, you can use long or short forms, as you please. For example, the search values
modified:9/29/22
and
modified:09/29/2022
are equivalent. (If you don’t mind typing the extra four letters, you can use datemodified: and get the same results.)
To search for dates before or after a particular date, use the less-than (<
) and greater-than (>
) operators. For example,
modified:>09/30/2022
searches for dates later than September 30, 2022. Use the same two operators to specify file sizes less than and greater than some value.
Use two periods to search for items within a range of dates. To find files modified in September or October 2022, type this search term in the Start menu search box:
modified:9/1/2022..10/31/2022
You can also use ranges to search by file size. The search filters suggest some common ranges and even group them into neat little buckets, so you can type size: and then click Medium to find files in the range 1 MB to 128 MB.
Again, don’t be fooled into thinking that this list represents the full selection of available sizes. You can specify an exact size range using operators such as >
, >=
, <
, and <=
. Also, you can use the ..
operator. For example, size:0 MB..1 MB is the same as size:<=1 MB. You can specify values using bytes, KB, MB, or GB.
You can use the Boolean operators AND, OR, and NOT to combine or negate criteria in the search box. These operators need to be spelled in capital letters (or they’re treated as ordinary text). In place of the AND operator, you can use a plus sign (+), and in place of the NOT operator, you can use a minus sign (–). You can also use parentheses to group criteria; items in parentheses separated by a space use an implicit AND operator. Table 9-1 provides some examples of combined criteria.
Table 9-1 Some examples of complex search values
This search value |
Returns |
---|---|
Mackie AND Lucy |
Items in which at least one indexed element (property, file name, or an entire word within its contents) begins with or equals Mackie and another element in the same item begins with or equals Lucy |
title:(“report” NOT draft) |
Items in which the Title property contains the word report (without the quote marks, this term would return any item whose title began with that word) and does not contain a word that begins with draft |
tag:tax AND author:Edward |
Items authored by Edward that include one or more tags that begin with the word Tax |
tag:tax AND author:(Ed OR Edward) AND modified:<1/1/20 |
Items authored by Ed or Edward, last modified before January 1, 2020, that have an entry in the Tags field that begins with Tax |
Note
When you use multiple criteria based on different properties, an AND conjunction is assumed unless you specify otherwise. The search value tag:Ed Author:Carl is equivalent to the search value tag:Ed AND Author:Carl.
File-search wildcards can be traced back to the dawn of Microsoft operating systems, well before the Windows era. In Windows 11, two of these venerable operators are alive and well:
The asterisk (*
), also known as a star operator, can be placed anywhere in the search string and matches zero, one, or any other number of characters. In indexed searches, which treat your keyword as a prefix, this operator is always implied at the end; thus, a search for voice turns up voice, voices, and voice-over. Add an asterisk at the beginning of the search term (*voice), and your search also turns up any item containing invoice or invoices. You can put an asterisk in the middle of a search term as well, which is useful for searching through folders full of data files that use a standard naming convention. If all your invoices start with INV, followed by an invoice number, followed by the date (INV-0038-20220227, for example), you can produce a quick list of all 2022 invoices by searching for INV*2022*.
The question mark (?
) is a more focused wildcard. In index searches, it matches exactly one character in the exact position where it’s placed. Using the naming scheme defined in the previous item, you can use the search term filename:INV-????-2022* to locate any file in the current location that has a 2022 date stamp and an invoice number (between hyphens) that is exactly four characters long.
To force Windows Search to use strict character matches in an indexed location, type a tilde (~) as the first character in the search box, followed immediately by your term. If you open your Documents library and type ~??v in the search box, you find any document whose file name contains any word that has a v in the third position, such as saved, level, and, of course, invoice. This technique does not match on file contents.
After you have completed a search and displayed its results in File Explorer, you can save the search parameters for later reuse. Right-click anywhere in the pane displaying the search results and click Save Search. The saved search is stored, by default, in %UserProfile%\Searches; keep the default name or give it a more descriptive name. You can run the search again at any time, using the then-current contents of the index, by clicking that saved search in the navigation pane or Searches folder. (For easier access, try pinning the Saved Search shortcut to Quick Access or to Start.)
When you save a search, you’re saving its specification (technically, a persistedQuery), not its current results. If you’re interested in the XML data that defines the search, right-click the saved search in your Searches folder, choose Open With, and choose a text editor like Notepad or WordPad.