IBM developerWorks
 
       BrainDump
  Home arrow BrainDump arrow Working with the Filesystem, Drives, Data,...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
VeriSign Whitepapers 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
BRAINDUMP

Working with the Filesystem, Drives, Data, and Search
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2007-07-12

    Table of Contents:
  • Working with the Filesystem, Drives, Data, and Search
  • File Compare (fc)
  • File Expansion Utility
  • File Properties

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th -1:00PM EST. Register Today!

    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

    More BrainDump Articles
    More By O'Reilly Media


       · This article is an excerpt from the book "Windows Vista in a Nutshell," published by...
     

    Buy this book now. 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.

    BRAINDUMP ARTICLES

    - Codes and Packages in Microsoft Project 2007
    - Windows 7: Rumors and Demos
    - XP SP3 Why Me?
    - Breaking Up Your Work in Microsoft Project
    - Breaking Work into Task-Sized Chunks
    - Putting Microsoft`s Worldwide Telescope Unde...
    - Handling Multiple Contracts with Indigo
    - Cleaning Out Your Data in XP
    - Multiple Service Contracts and Indigo
    - Cleaning Out Your Programs in XP
    - Handling Metadata with Indigo
    - Building Blocks for a WCF Service Web Site
    - Help! I Need Some Remote Assistance
    - Using Service Templates with Indigo
    - Windows XP Tips for Task Manager





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway