Logo
HOW TO
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
 
 
Windows Server

Windows Server 2008 Server Core : Decompressing Files with the Expand Utility, Performing Advanced File Comparison with the FC Utility

11/23/2012 5:28:54 PM

1. Decompressing Files with the Expand Utility

The Expand utility lets you open the contents of a cabinet (CAB) file or compressed file and extract the contents. Generally, you use it to extract a missing file from a CD or other media, most notably Windows files. The advantage of using this utility is that you can use it with batch or script files to automate repair actions. An administrator can save time and effort using this approach for common repairs or repairs that must be made to a group of machines.

Using Modern Compression Techniques

Computing constantly changes, but some command line utilities don't keep up. Either they work fine as is, or Microsoft simply decides to let a third party do the job. At one time, CAB files were the only form of compression widely available to Windows users. Today, third-party utilities, such as WinZIP (a share-ware utility you can download and try before you buy), have largely replaced the need for this particular utility when working with CAB files. However, you must still use Expand when working with compressed files—those that have an underscore as part of their file extension. For example, you'd always use Expand to expand a file named MyApp.EX_ to MyApp.EXE. To make things easier for administrators, WinZIP has a command line add-in (http://www.winzip.com/prodpagecl.htm) that you can use much like the Expand utility for a much broader range of compressed file types. Even so, you'll still find that you need the Expand utility, in some cases, such as when you use the recovery console, simply because it's the only tool available.


You can use the Expand utility in one of several ways. The information you provide depends on the way in which you want to use the utility. This utility uses the following syntax:

EXPAND [-r] Source Destination
EXPAND -r Source [Destination]
EXPAND -D Source.cab [-F:Files]
EXPAND Source.cab -F:Files Destination

Essentially, you must always provide at least two kinds of information or make an assumption about the output of the utility. For example, if you supply the source filename and use the -r command line switch, Expand makes an assumption about the output filename based on the source filename. The following list describes each of the command line arguments.


Source

Name of the compressed file. The Expand utility works with single compressed files (those with an underscore in the file extension) and CAB files. It doesn't work with newer MSI, ZIP, or other compressed files.


Destination

Name of the uncompressed file when working with a single file. The destination folder for the uncompressed files when working with a CAB file.


-r

Renames the destination filenames based on the source filename. For example, when you supply MyApp.EX_ as the source filename, Expand automatically uses MyApp.EXE as the output filename. This option works by using the full name of the file that's embedded as part of the compressed file. 


-D

Displays the list of files in the source file. When used with a single compressed file, you see only a single filename as output. CAB files normally contain multiple files.


-F:
Files

Decompresses one or more selected files within a CAB file. You can specify multiple files by supplying wildcard characters. (See the "Working with Wildcard Characters" sidebar for details.) Don't use multiple copies of the -F command line switch to specify multiple discrete files. When you want to expand single files from a CAB file, you must use the Expand utility once for each file.

The Expand utility is extremely useful because it doesn't require a running copy of Windows to work. For example, you can use this utility from the Recovery Console where other third-party utilities will fail to work. 

2. Performing Advanced File Comparison with the FC Utility

The FC utility is a slightly advanced form of the Comp utility described in an earlier section. You can use it for the same types of activities, but perform a more flexible comparison of the two files. For example, this utility has a comparison mode specifically designed for binary files. This utility uses the following syntax (the first is for ASCII files; the second is for binary files):

FC [/A] [/C] [/L] [/LBn] [/N] [/OFF[LINE]] [/T] [/U] [/W] [/nnnn]
   [drive1:][path1]filename1 [drive2:][path2]filename2
FC /B [drive1:][path1]filename1 [drive2:][path2]filename2

The following list describes each of the command line arguments.


/A

Displays only the first and last lines for each set of differences. Normally, the FC utility (like the Comp utility) displays every line for a set of differences, making the output difficult to read when the files have a lot of differences.


/B

Performs a binary comparison of the two files. This means that the FC utility won't interpret control characters such as linefeed, carriage return, and end of file character (ASCII character 26) as it would when performing an ASCII comparison.


/C

Performs a case-insensitive comparison of the two files. Normally, FC considers an upper-case letter different from a lowercase letter.


/L

Performs an ASCII text comparison of the two files. This setting means that control characters become important in the comparison, as do the actual character meanings.


/LB
n

Defines the maximum acceptable mismatches between the two files. When FC reaches n, it stops performing the comparison.


/N

Displays the line numbers for differences. The FC utility compares the two files line by line, where the carriage return (ASCII character 13), linefeed (ASCII character 10), or both designate the end of a line.


/OFF[LINE]

Forces the FC utility to compare files even when the files have the offline attribute set.


/T

Forces the FC utility to retain tabs within the output. Normally, it displays tabs using the default number of spaces (usually 8) between characters.


/U

Performs a Unicode comparison of the two files. Unicode character sets include additional characters to meet the needs of languages other than English. In addition, Unicode character sets often include characters designed to express both scientific and mathematical output.


/W

Compresses tabs and spaces for the purposes of comparison. You'd use this feature when comparing two data files where the content is important, but the manner of presentation isn't. Using this technique would let you compare the actual content of a raw data file against its formatted counterpart.


/nnnn

Specifies the number of consecutive lines that must match after a mismatch to continue the comparison. If the source and destination files don't compare more often than this number allows, then FC discontinues the comparison.


[drive1:][path1]filename1

Specifies the source file. You can use wildcard characters to define multiple comparisons. For example, *.DLL compares every dynamic link library in the source directory against a DLL with the same name in the destination directory.


[drive2:][path2]filename2

Specifies the destination file. You can use wildcard characters to define multiple comparisons. However, the source and destination specifications must compare. If the source contains just one file, then the destination will also contain one file as well.

Other -----------------
- Windows Server 2008 Server Core : Modifying Files with the Edlin Utility, Repairing System Databases with the ESEnTUtl Utility
- Microsoft Dynamics CRM 4.0 : Silverlight - Tools and Resources
- Microsoft Dynamics CRM 4.0 : Infrastructure Design Considerations - Windows SharePoint Integration
- Connecting Dynamics GP to Microsoft Office 2010 : Improving performance by globally turning off Outlook integration
- Connecting Dynamics GP to Microsoft Office 2010 : Skipping the exports by using Prebuilt Excel Reports
- Microsoft Dynamics AX 2009 : Integration with Microsoft Office - Reading Excel files
- Microsoft Dynamics AX 2009 : Integration with Microsoft Office - Creating Excel files
- SQL Server 2008 R2 : Configuring Resource Governor (part 2) - Defining Workload Groups, Creating Workload Groups in T-SQL
- SQL Server 2008 R2 : Configuring Resource Governor (part 1) - Enabling Resource Governor, Defining Resource Pools
- SQL Server 2008 R2 : Overview of Resource Governor, Resource Governor Components
 
 
REVIEW
- First look: Apple Watch

- 10 Amazing Tools You Should Be Using with Dropbox

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
 
VIDEO TUTORIAL
- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 1)

- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 2)

- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 3)
 
Popular tags
Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8 BlackBerry Android Ipad Iphone iOS
Popular keywords
HOW TO Swimlane in Visio Visio sort key Pen and Touch Creating groups in Windows Server Raid in Windows Server Exchange 2010 maintenance Exchange server mail enabled groups Debugging Tools Collaborating
Top 10
- Microsoft Excel : How to Use the VLookUp Function
- Fix and Tweak Graphics and Video (part 3) : How to Fix : My Screen Is Sluggish - Adjust Hardware Acceleration
- Fix and Tweak Graphics and Video (part 2) : How to Fix : Text on My Screen Is Too Small
- Fix and Tweak Graphics and Video (part 1) : How to Fix : Adjust the Resolution
- Windows Phone 8 Apps : Camera (part 4) - Adjusting Video Settings, Using the Video Light
- Windows Phone 8 Apps : Camera (part 3) - Using the Front Camera, Activating Video Mode
- Windows Phone 8 Apps : Camera (part 2) - Controlling the Camera’s Flash, Changing the Camera’s Behavior with Lenses
- Windows Phone 8 Apps : Camera (part 1) - Adjusting Photo Settings
- MDT's Client Wizard : Package Properties
- MDT's Client Wizard : Driver Properties
 
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
2015 Camaro