Working with the Filesystem, Drives, Data, and Search
(Page 1 of 4 )
If you're looking for a guide to the Windows Vista filesystem, you've come to the right place. This article, the first of three parts, is excerpted from chapter four of the book
Windows Vista in a Nutshell, written by Preston Gralla (O'Reilly, 2006; ISBN: 0596527071). Copyright © 2006 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media.
At the heart of Windows Vista are the filesystem and the files in it; without files, there's no reason to use a computer, after all. When Windows Vista was first announced, Microsoft had big plans for a completely redone filesystem, along with powerful search tools, all built on top of a new filesystem database.
Reality intruded, and those plans had to be curtailed. Still, despite that, the ways to navigate your hard disk and find files have been dramatically upgraded compared to previous versions of Windows. Windows Explorer has gotten a facelift, along with new capabilities for filtering and viewing files. And the new Search is one of Windows Vista's best new features. Not only is it available almost everywhere, but it's also lightning fast and includes considerable new ways to search, including the ability to save searches for future use. This chapter covers that, along with all other aspects of the filesystem, Windows Explorer, and Search.
Here is an alphabetical reference of entries in this chapter:
| Explorer | Folder and Search Options | OpenFiles |
File Compare (comp) | Folder Properties | Search |
File Compare (fc) | Indexing Options | Shadow Copies |
File Expansion Utility | Label | Subst |
| File Properties | NTFS Compression Utility | Windows Explorer |
Explorer
See "Windows Explorer, "later in this chapter.
File Compare (comp)
\windows\system32\comp.exe Compare the contents of two files (or sets of files) byte by byte and display the differences between them.
To open
Command Prompt -> comp
Usage
comp [file1] [file2] [/n=number] [/c] [/offline] [/d] [/a] [/l]
Description
File Compare (comp.exe) compares two files (or more, using wildcards) and reports whether the files are identical. If the files are identical, comp.exe will report Files compare OK. If the files are the same size but have different contents, comp.exe displays the differences, character by character, by reporting Compare Error at OFFSET n (where n is the byte offset, or the location of the difference, in characters, from the beginning of the file). If the files are different sizes, comp.exe reports Files are different sizes, and the comparison stops there.
Here are the options for comp.exe:
file1, file2
Specify the filenames of the files to compare. For any
files that aren't in the current directory, you'll need to
include the full path. If file1 includes a wildcard, all
matching files are compared to file2 . Likewise, if
file2 includes a wildcard, each matching file is
compared to file1 . If one or both of these
parameters are omitted, comp.exe will prompt you for
the files to be compared.
/n=number
Include the /n option to compare only the first
specified number of lines in the files, or omit it to
compare the files in their entirety. For example,
specify /n=5 to check on the first five lines in each
file.
/c
Disregard the case of ASCII characters; upper-and
lowercase letters are treated as identical.
/offline
comp.exe normally skips files marked as "offline."
Specify /offline (or just /off) to include offline files
as well. (See "Sync Center," in Chapter 7, for more
information on offline files.)
/d
Display differences in decimal format.
/a
Display differences in ASCII characters. The /a option
is the default, so specifying it has no effect.
/l
Include line numbers in any output.
Notes
- Windows Vista actually comes with two file comparison utilities: comp.exe (this one) and fc.exe (discussed in the next section). comp.exe performs a character-by-character comparison, but displays differences only if the files are exactly the same size. fc.exe performs a line-by-line comparison and works regardless of the file sizes. For most users, fc.exe will be the tool of choice, as it displays the differences between the files and doesn't have any prompts, so you can use it from a WSH script or batch file.
- You can also use File Compare in interactive mode, without first typing filenames. Type comp at the command prompt, and you'll be asked for the names of files to compare, along with any options for comparing.
- Regardless of the outcome of the comparison, comp.exe will ask whether you want to perform another comparison. Although there's no way to disable this prompt, you can use the following workaround to bypass it:
echo n | comp file1 file2
Next: File Compare (fc) >>
More BrainDump Articles
More By O'Reilly Media
|
This article is excerpted from chapter four of the book Windows Vista in a Nutshell, written by Preston Gralla (O'Reilly, 2006; ISBN: 0596527071). Check it out today at your favorite bookstore. Buy this book now.
|
|