Draft for Information Only
ContentMS DOS Command: FC.EXE
MS DOS Command: FC.EXEReference from Microsoft MS-DOS cmd help DescriptionCompares two files and displays the differences between them. SyntaxTo make an ASCII comparison, use the following syntax: FC [/A] [/C] [/L] [/LBn] [/N] [/T] [/W] [/nnnn][drive1:][path1]filename1 [drive2:][path2]filename2
To make a binary comparison, use the following syntax: FC /B [drive1:][path1]filename1 [drive2:][path2]filename2
Parameters
Switches
RemarksReporting differences between files for an ASCII comparisonWhen you use FC for an ASCII comparison, MS-DOS reports differences between two files by displaying the name of the first file, followed by the last line to match in both files, followed by the lines from filename1 that differ between the files, followed by the first line to match in both files. MS-DOS then displays the name of the second file, followed by the last line to match, followed by the lines from filename 2 that differ, followed by the next line to match. Using the /B switch for binary comparisonsMS-DOS uses the following format to report mismatches found during a binary comparison: xxxxxxxx: yy zz The value of xxxxxxxx specifies the relative hexadecimal address for the pair of bytes, measured from the beginning of the file. Addresses start at 00000000; the hexadecimal values for yy and zz represent the mismatched bytes from filename1 and filename2, respectively. Using wildcardsYou can use wildcards (* and ?) in either of the filenames you specify with the FC command. If you use a wildcard in filename1, FC compares all the specified files to the file specified by filename2. If you use a wildcard in filename2, FC uses the corresponding value from filename1. How FC uses memoryWhen comparing ASCII files, FC uses an internal buffer (large enough to hold 100 lines) as storage. If the files are larger than the buffer, FC compares what it can load into the buffer. If FC does not find a match in the loaded portions of the files, it stops and displays the following message: Resynch failed. Files are too different.When comparing binary files that are larger than available memory, FC compares both files completely, overlaying the portions in memory with the next portions from the disk. The output is the same as that for files that fit completely in memory. ExamplesEither of the following commands changes your current directory to the directory named PRIMETIM:Suppose you want to make an ASCII comparison of two text files that are named MONTHLY.RPT and SALES.RPT, and you want to display the results in abbreviated format. To make this comparison, type the following command: fc /a monthly.rpt sales.rpt To make a binary comparison of two batch files named PROFITS.BAT and EARNINGS.BAT, type the following command: fc /b profits.bat earnings.bat The results of this command will be similar to the following:
If the PROFITS.BAT and EARNINGS.BAT files were identical, FC would display the following message: FC: no differences encountered To compare every .BAT file in the current directory with the file NEW.BAT, type the following command: fc *.bat new.bat To compare the file NEW.BAT on drive C with the file NEW.BAT on drive D, type the following command. fc c:new.bat d:*.bat To compare each batch file in the root directory on drive C to the file with the same name in the root directory on drive D, type the following command: fc c:\*.bat d:\*.bat ©sideway ID: 110700183 Last Updated: 7/27/2011 Revision: 0 Latest Updated Links
![]() ![]() ![]() ![]() ![]() |
![]() Home 5 Business Management HBR 3 Information Recreation Hobbies 8 Culture Chinese 1097 English 339 Travel 18 Reference 79 Computer Hardware 254 Software Application 213 Digitization 37 Latex 52 Manim 205 KB 1 Numeric 19 Programming Web 289 Unicode 504 HTML 66 CSS 65 SVG 46 ASP.NET 270 OS 431 DeskTop 7 Python 72 Knowledge Mathematics Formulas 8 Set 1 Logic 1 Algebra 84 Number Theory 206 Trigonometry 31 Geometry 34 Calculus 67 Engineering Tables 8 Mechanical Rigid Bodies Statics 92 Dynamics 37 Fluid 5 Control Acoustics 19 Natural Sciences Matter 1 Electric 27 Biology 1 |
Copyright © 2000-2025 Sideway . All rights reserved Disclaimers last modified on 06 September 2019