One of the features of the NTFS filesystem (see "FAT to NTFS Conversion Utility," in Chapter 11) is its support for automatic compression of individual files; older files can be optionally compressed to take up less disk space at the expense of speed to access them.
Right-click on any file or folder, select Properties, and then click the Advanced button. The "Compress contents to save disk space" option is used to instruct Windows to compress the selected item. If a folder is selected, all of its contents will be compressed (you'll be prompted about any subfolders); furthermore, any files added to that folder will be automatically compressed as well.
The NTFS Compression Utility is the command-line equivalent of this setting, useful for automating the compression or decompression of several files with the help of a WSH script or batch file. The NTFS Compression Utility takes the following options:
filename Specifies a file, folder, or group of files (using wildcards) to compress or uncompress.
/c Compresses the specified file(s). If a folder is specified for filename , the folder will be marked so that subsequent files added to the folder will be compressed automatically. Include the /s parameter to compress files already in the folder.
/u Uncompresses the specified file(s). If a folder is specified for filename , the folder will be marked so that subsequent files added to it will not be compressed automatically. Include the /s parameter to uncompress files already in the folder.
/s If a folder is specified for filename , the /c and /u parameters will act only on new files added to the folder. Include the /s parameter as well to compress or uncompress files already in the folder. If filename is omitted, use the /s option to act on all files in the current folder.
/a Includes files with hidden or system attributes set; otherwise, ignored by compact. exe.
/i Ignores errors; otherwise, compact.exe will stop when the first errors are encountered.
/f Forces compression on all specified files; otherwise, files that are already compressed will be skipped.
/q Quiet mode; use this option to report only the most essential information.
If you run the NTFS Compression Utility without any options, it will display the compression settings for the current directory and all of its contents.
Notes
This type of file compression is supported on NTFS drives only.
Go to Windows Explorer -> Organize -> Folder and Search Options -> View tab and turn on the "Show encrypted or compressed NTFS files in color" option to visually differentiate such files from unencrypted, uncompressed files.
For tangible proof that a given folder or file is actually compressed, right-click on it in Explorer and select Properties. If the "Size on disk" value is less than the "Size" value, the item is compressed.
List all currently open files, either shared and accessed by other users on a network or (optionally) opened locally.
To open
Start -> type command into the Search field -> right-click on Command Prompt -> Run as Administrator
Usage
openfiles /local [ on | off ] openfiles /query [/s system [/u user [/p [pass]]]] [/fo format] [/nh] [/v] openfiles /disconnect [/s system [/u user [/p [pass]]]] {[/id id] [/a accessedby] [/o openmode]} [/op openfile]
Description
The OpenFiles tool lets you view a list of all the shared files that are currently open across the network and, optionally, files that are opened locally. You can use this to avoid deleting or changing a document that a remote user is working on.
Type openfiles without any options to display a report such as this:
Files Opened Remotely via local share points: -------------------------------------- ID Accessed By Type Open File (Path\executable) ===== ============= ========== ========== 98 LOU Windows C:\Stuff to Eat\frittatas.txt 101 EDDIE Windows C:\Stuff to Drink\milkshakes.txt 107 CLANCY Windows C:\Stuff to Eat\pork chops.txt
OpenFiles accepts one of three primary commands, each of which has a range of parameters:
/local [parameters]
Turn on or off the inclusion of local files in reports. Type:
openfiles /local on
to turn on the "maintain objects list" global flag; this setting is turned off by default and requires Windows to be restarted when changed. Note that turning on this setting may slightly reduce performance.
/query [parameters]
Display a list of opened files and folders; specify /query for more flexibility than using openfiles without any options, such as the ability to connect to a different machine. Type openfiles /query /? for more information on the available parameters.
/disconnect [parameters]
Selectively disconnect files and folders that have been opened remotely. When viewing the list of open files, each entry has an ID; you can use that ID to close open files. Type openfiles /disconnect /? for more information on the available parameters.
Notes
OpenFiles is available only to a user with administrator privileges.
Search has been embedded so deeply into Windows Vista and Windows Explorer that at first it can be difficult to know where to begin. Should you use the Search box inside Windows Explorer? The one inside Internet Explorer? The Start Search box that appears when you click the Start button? How about choosing Start -> Search to go straight to the Search Folder and Advanced Search screen?
Table 4-1 shows the major ways you can perform a search in Windows Vista and recommendations on when to use which.
Table 4-1. Different ways to search
Search method
When to use it
Search box in Windows Explorer
Best for searching inside individual folders and subfolders, because it searches only the current folder and subfolders. Also best for searching on filenames.
Start ? Search (leads to Search folder and Advanced Search)
Best for performing complex searches across multiple folders and for when you want to save a search for future use.
Start Search box on the Start menu
Best for quick searches across multiple folders or for searching the Internet. Not good for searching for filenames.
Search box in Internet Explorer
Best for searching the Internet.
Windows Vista performs a search while you type your search term into a Search box. So as you type the letters vis, for example, it will display all files that have vis in them and will narrow the search as you type more letters into the box.
Understanding searching and the index
When you search for a file on your computer, you aren't actually searching your entire hard disk. Instead, you're searching the Windows Vista index, which makes searching lightning fast.
Sometimes you will search outside the index. For example, when you perform a search inside a folder, you also search the filenames inside the folder, not just the index. And, as explained later, you can also expand your search to nonindexed locations when you want.
Although the index makes searching lightning fast, it can cause some confusion, as well. By default, your entire PC is not indexed, because doing that would defeat the purpose of the index--it would get so large that it would slow down your search.
By default, the following are indexed:
Your user folder (\Users\username ), which contains your Documents, Music, Pictures, and Videos folders, as well as Contacts, Favorites, and the hidden AppData folder, which contains your Windows Mail messages.
Offline files, which are files stored on a server or network drive that you have configured to be available offline. For details, see "Offline Files," in Chapter 7.
The contents of your Start menu.
That's well and good, but what happens if you don't store files and folders underneath your user folder? What if you store them in other places on your hard disk? Then you won't find them when you perform a search, unless you specifically search for them outside the index, which of course defeats the purpose of the index.
There is a solution, however. You can add any folders you want to the index (and take them away, as well). For details, see "Indexing Options," earlier in this chapter. A simple way to get to the Indexing Options screen is from Windows Explorer, by choosing Search Tools -> Modify Index Locations. (The Search Tools icon appears only after you type text into the Search box.)
The Windows Explorer Search box
The Search box in Windows Explorer searches only within the current folder and subfolders beneath it. It searches the index and the names of files in the folder and subfolders, and displays results directly in Windows Explorer, as you can see in Figure 4-16.
Figure 4-16. Results when searching from a folder in Windows Explorer
You can sort, filter, group, and stack the results, as you can normally with Windows Explorer. (For details, see "Windows Explorer," later in this chapter.)
At the bottom of your results, you'll see a "Did you find what you were searching for?" heading. Beneath that, you will see an Advanced Search link, which will launch an advanced search when clicked. (See the next section, "The Search Pane and Advanced Search," for details.) If the folder you've searched through hasn't been indexed, you'll also see a link to "Search in File Contents," which will search the actual contents of the files in the folder, rather than just the filenames.
The Search Pane and Advanced Search
To make it easier to search in a folder, you can turn on the Search Pane (Figure 4-17), by selecting Organize -> Layout -> Search Pane.
Figure 4-17. The Search Pane in Windows Explorer, which makes it easy to search for specific file types
The Search Pane is not normally available as an option from Organize -> Layout. However, as soon as you type text into the Search box, the option will be available. Delete the search or move your cursor out of the box, and the Search Pane will no longer be available. However, the option is always available from the Computer and Desktop folders.
The Search Pane makes it easy to search for different file types; click the file type for which you want to search, and then perform your search.
The Search Pane also displays an Advanced Search button at the far right of the screen. Click it, and Advanced Search appears (Figure 4-18). Use of Advanced Search is self-explanatory and needs no further clarification. If you want to search outside the index, check the box next to "Include non-indexed, hidden, and system files," although as Windows Vista warns you, this may slow down your search considerably.
Figure 4-18. Advanced Search, which lets you fine-tune your searches
The Location field can be extremely useful if you're on a network, because you can add network drives and folders to your search. Select "Choose search locations" from the Location field, then browse to the network PCs, folders, and devices you want to search (Figure 4-19) and include them in the search.
Figure 4-19. Adding network locations to your search
The Start Search box
The Start Search box on the Start menu works much like the Search box in Windows Explorer, with some differences. It searches your entire PC, not just within an individual folder and subfolders. As you type, it shows you these results, grouped according to the types listed here (and shown in Figure 4-20):
Programs (includes utilities and Control Panel applets as well as programs)
Favorites and History (from the Internet)
Files (includes folders and shortcuts)
Communications (email and chat transcripts)
Click any result to view it, open it, or launch it. To see all results in Windows Explorer, click "See all results." To search the Internet using your default search engine, click "Search the Internet," and a search will be launched using your default browser.
Figure 4-20.Searching from the Start menu
The Search folder and saving searches
When you choose Start -> Search, you're sent to the Search Results folder (Users\username\Search Results), which starts as a blank Windows Explorer screen, with the Search Pane turned on. You can do a basic Windows Explorer search from here, or turn on Advanced Search in the usual way. Even starting in the Users\username\Search Results folder, though, youll do a search of your entire PC, not just the individual folder.
To save a search, click Save Search. From the screen that appears (Figure 4-21), give the search a name. File extensions for searches are .search-ms, and by default, they are saved in the \Users\username\Searches folder, but you can save them to any folder.
There are many ways to return to a saved search. You can navigate to the .search-ms file and double-click it. There's a faster way, though: in the Navigation Pane, click More under Favorite Links, and choose Searches. You'll be sent to the \Users\username\ Searches folder, and a list of all saved searches will appear--not just those that you've created, but also those that Windows Vista has already created for you, including searches for all recent documents, recent email, recent music, and more.
Figure 4-21. Saving a search so that you can latter return to it
Note that you can save searches not only when you use Start -> Search, but also when you're inside any folder in Windows Explorer. Your searches will be saved by default to your Search folder, no matter where you start your search.
Using Search Properties and syntax
The Windows Explorer Search box (and other search boxes also) lets you search using file properties, as well as a specialized syntax that makes finding files easier. You can search on any metadata associated with any files as a quick way to find what you want. Table 4-2 shows you some of the more common properties you can search on and how to search using them.
Table 4-2. Search properties
Property
Property description
How to search for it
Filename
The name of the file.
Type part or all of the filename. To find a file named budget.xls, you could type budg or .xls.
Kind of file
A description of the file, such as Document, Picture, Video, or Music.
Type the kind of filefor example, Music for any music files.
File extension
The file extension, such as .xls, .doc, .jpg, and so on.
Type the filename extension. You can also use wild-cards for example, *.mp3.
Tags
Words or phrases you or others added to the files to describe them.
Type a tag to see a list of files that have the matching tag.
Author
The person who created the file.
Type the name of the author.
Use properties with the proper syntax to narrow the search. For example, to search for files that have the name "budget" in them, you would type this:
Name:budget
To search for files with the tag of "budget" you would type:
Tag:budget
To find files modified on November 7, 2006, you would type:
Modified:11/07/2006
You can also use the Boolean filters AND, NOT, and OR; the comparison operators > and <; and grouping syntax, such as "" and (). Furthermore, you can combine them with searching for file properties.
If you want to forgo complex searches and having to remember search syntax, you can also use natural language search, which, as explained earlier, is the ability to search for files using plain English rather than complex syntax.
For example, instead of typing:
Kind:music artist:(Gluck or Salieri)
you could type:
Music by Gluck or Salieri
If you want to do that, you'll have to turn on natural language search, using the Search tab of the Folder Options window. See "Folder and Search Options," earlier in this chapter, for details.
Notes
When using Boolean filters, you have to capitalize AND, NOT, and OR.
To modify how and where to search--for example, whether to include subfolders in searches, when and how to use the index, and so on--use the Search tab of the Folder Options screen. For details, see "Folder and Search Options."
See also
"Windows Explorer," "Folder and Search Options," and "Indexing Options"
Shadow Copies
Shadow copies are made every time Windows Vista creates a restore point, and they can be used to restore previous versions of files. See "System Protection and System Restore," in Chapter 11, and "File Properties," in this chapter, for details.
Create a new drive letter that is linked to a folder on your hard disk.
To open
Command Prompt -> subst
Usage
subst [drive:] [path | /d ]
Description
Subst is a neat little utility that creates a new drive letter and actively links it to an existing folder on your hard disk. For example, type:
subst z: c:\opera\Cecilia Bartoli
to create a new drive letter, z:, and link it to the folder c:\opera\Cecilia Bartoli. When you open drive z: in Explorer, you'll see the contents of the linked folder. This is very useful if you access a particular folder frequently but find Windows shortcuts too limiting. For example, a drive created with Subst allows you to access a file in the folder, like this: z:\ Se mai senti.mp3. To disconnect a Subst'd drive, type:
subst z: /d
Notes
Any drive letters created with Subst are forgotten when the computer shuts down.
The default Windows interface, including the Start menu, the Desktop, the Taskbar, the Search tool, the Windows Explorer window, and all folder windows.
To open
Start -> All Programs -> Accessories -> Windows Explorer
Command Prompt -> explorer
Double-click any folder icon on the Desktop or in any folder window.
The Explorer is the default Windows shell (see Figure 4-22). When run without any command-line parameters, it opens a two-paned window (commonly referred to simply as Explorer) in which you can navigate through all of the files, folders, and other resources on your computer.
See Chapter 2 for basic navigation and file management principles, and Chapter 3 for discussions of the visual elements.
Explorer accepts the following command-line options (note the mandatory commas):
/n Forces Explorer to open a new window (even if the specified folder is already open somewhere).
/select],subobject
Include subobject to specify the file or folder to be initially highlighted or expanded when the folder is opened. If subobject is a folder, it will be expanded in the tree. If you also include the /select parameter (not valid without subobject ), the parent of the specified folder is highlighted on the tree, no branches are initially expanded, and subobject will be highlighted in the right pane.
,/root,object
By default, Explorer opens with the Desktop as the root folder. Use ,/root,object to specify a different root. The object parameter can be a folder name or a class ID.
Figure 4-22. Windows explorer, the primary means of file and folder management in Windows Vista
For example, if you want Explorer to open to the Computer folder so that no drive branches are initially expanded (which is handy if you have several drives), type the following:
explorer.exe /n, /select, c:\
To open an Explorer window rooted at the Documents folder, type:
explorer.exe /root,c:\Documents and Settings\username\Documents
where username is the username of the owner of the Documents folder.
The Windows Explorer Toolbar
Depending on the type of folder you're viewing, the Windows Explorer Toolbar changes to offer context-sensitive buttons, although it always has the basic Organize and Views buttons. For example, when viewing the Computer folder (Figure 4-23), there are icons for viewing file and object properties, viewing system properties, uninstalling or changing a program, mapping a network drive, and opening the Control Panel.
If the folder you're viewing is filled with music, a different toolbar appears and includes buttons for playing music and burning a CD. A folder with pictures and videos, meanwhile, would include buttons for playing a slide show and burning a CD. You can customize your view of folders using the Customize tab of the Folder Options dialog box. (See "Folder and Search Options," earlier in this chapter.)
If the folder has pictures in it, you can play a slide show that displays the pictures one by one, using the Slide Show button. For details, see "Slide show," in Chapter 12.
Figure 4-23.The Windows Explorer Toolbar for the Computer folder
Windows Explorer views
The Views button on Windows Explorer pops up a menu (Figure 4-24) that lets you choose among seven different folder views:
Extra Large Icons
Large Icons
Medium Icons
Small Icons
List
Details
Tiles
Figure 4-24. The Views menu in Windows Explorer
The four icon views are self-explanatory. Windows Explorer folder icons are "live"--that is, they will display live thumbnails of the contents within them so that you can see thumbnails of pictures contained in the folder. The larger the icon, the easier it is to see these live thumbnails.
The List view does what it says--provides only a list of the files. The Details view lists the files and displays information about each, such as file size, date created, and so on. The information displayed about each will vary according to the folder type. The Tiles view is a combination of an icon view and a List view; it shows thumbnails of each file but also displays information about them.
To see basic information about any file, in any view, hover your mouse over it. A balloon will appear displaying the file type, file size, and other information that changes according to the type of file.
If the folder has pictures in it, you can play a slide show that displays the pictures one by one, using the Slide Show button. For details, see Slide show, in Chapter 12.
Windows Explorer panes
Windows Explorer has four main panes that you can turn on and off by choosing Organize -> Layout:
Search Pane Displays the Search toolbar (see "Search," earlier in this chapter, for details)
The Search Pane option appears only when you type text into the Search box. If you delete the text, the Search Pane will no longer be available as an option. However, it is available as an option from the Desktop and Computer folders.
Details Pane Shows, at the bottom of the screen, information about the object currently highlighted
Preview Pane Shows, on the righthand side, a preview of the file currently highlighted
Navigation Pane Shows folders and objects on the lefthand side of the screen in tree-style view for navigating
Figure 4-25 shows Windows Explorer with the panes labeled.
Stacking and sorting
Windows Vista introduces new ways to filter and display files in Windows Explorer by grouping and stacking files based on their metadata. In Windows Explorer, if you click in the right side of any property header (Name, Size, Rating, and so on), a down arrow appears, along with a drop-down list that includes buttons labeled Sort, Group, and Stack. The Sort button is the default for Windows Explorer. The Group button displays files in separate groups, according to the value of the property--for example, by rating, as shown in Figure 4-26.
You can collapse and expand any group by double-clicking the group title--for example, 3 Stars. In addition, you can display only some groups and not others. In the example in Figure 4-26, if you selected 3 Stars instead of Group, you would display only files that were rated three stars.
Figure 4-25. The Four panes in Windows Explorer
If you instead chose Stack, it would organize the files into what look like subfolders--in our example, by three stars, four stars, and five stars. To see the files in any stack, double-click the stack.
Modifying file tags and properties
Every file on your system has tags and properties associated with it, and these are displayed in several places in Windows Explorer--on the righthand side of the screen when using Details or Tiles views, when hovering a mouse over the file, and in the Details Pane. They're also shown inside many applications. And when you do a search for files, those tags and properties are searched through as well.
You often can modify tags and properties using the program that created the file, but you can also use Windows Explorer to modify them. Turn on the Details Pane, then highlight the file whose property you want to change. In the Details Pane, click the property you want to change, edit what's there or add new text, and click Save.
To add tags, type them directly into the Tags field; separate multiple tags with semicolons, as shown in Figure 4-27.
Figure 4-26. Stacking Files based on rating metadata
Figure 4-27. Adding tags to a file using the Details Pane
Certain properties that are inherent to the file itself can't be changed, such as file size and dimensions.
Windows Explorer Address Bar
The Address Bar is covered in some detail in Chapter 3, so there is no need to go into detail about it here. However, there is one unique, often overlooked aspect of Windows Explorer's Address Bar--the menu that appears when you right-click it (Figure 4-28).
Figure 4-28. The little-known Address Bar menu
You can use it to copy the address to the Clipboard. The Edit Address choice turns the Address Bar into a text menu that lets you type in text. Figure 4-29 shows you how the Address Bar changes when you edit it as text.
Figure 4-29.Using text in the Address Bar
Using ZIP archives in Windows Explorer
Using Windows Explorer, you can compress files and put them into packages using the .zip format, or simply compress individual files. In addition, Windows Explorer lets you look inside .zip archives and uncompress them.
In Windows Explorer, select the file or files that you want to compress, right-click them, and choose Send to -> Compressed (zip) folder. A ZIP file will be created in the current folder, with the name of the file or the first file in the group, and ending in the .zip extension. You can rename it to what you want.
You can view files inside .zip archives just as you can any other folder. But if you double-click a file in the folder, you'll open a read-only copy. To make changes to the file, choose File -> Save As and save it on your hard drive. You can instead extract the files from the archive, and then work with them after they've been extracted. Right-click the .zip file, select "Extract all," and then extract the files to any location.
CD burning
You can "burn" data directly to a CD or DVD using Windows Explorer. Click the Burn button and follow the directions. But keep in mind that this burns only a data disc--that is, it merely copies files from your PC to the disc. You won't be able to play it in a CD player that plays only music CDs. To burn a music CD, you need to use Windows Media Player. See "Windows Media Player," in Chapter 12, for details.
Notes
Some folders in Windows Vista are junctions, which means that they don't actually exist and are only pointers to another folder. These junctions are used to preserve holdovers from earlier versions of Windows, and they are there so that programs written for earlier versions of Windows can continue to function properly. For example, the Documents and Settings folder is a junction, and if you try to access it in Windows Explorer, you will get the error message "Documents and Settings is not available." If you look at the Documents and Settings folder, you'll see that it's actually a shortcut; it has the shortcut icon on the folder itself. It points to the \Users folder, which has replaced it.
If you turn on the Search Pane in a folder and use it to do a search, you will search only in that folder, not across your entire computer.
See also
"Folder Properties," "File Properties," and "Search," in this chapter, and Internet Explorer, in Chapter 5