FCOM/FCOM32 is a File Compare utility program that compares two files and determines if the two files are the same. The results are returned on screen and in the form of a DOS errorlevel. The errorlevel can be used in batch files to have the batch file perform specific tasks based on the results of the error level. Sample test batch files are included in the attached zip archive.
The FCOM.ZIP file comes with two versions of FCOM. FCOM.COM (DOS/Win16) and FCOM32.EXE (Win32). The latter version was created when a user reported that FCOM.COM did not work correctly with Long File Names that contained spaces. Therefore a Win32 version was created.
How do I use FCOM?
Usage: FCOM [drive1:][path1]filename1 [drive2:][path2]filename2 /Q
[drive1:][path1][filename1] - Specifies source drive, directory, and file to compare.
[drive2:][path2][filename2] - Specifies target drive, directory, and file to compare.
/Q --> Quite Mode. Do not display any messages. NOTE: Must be last parameter.
Errorlevel Return Values:
-1 --> Error
0 --> Files are the same
1 --> Files are NOT the same
How do I use FCOM32?
Usage: FCOM32 [drive1:][path1]filename1 [drive2:][path2]filename2 [/Q | /?]
[drive1:][path1][filename1] - Specifies source drive, directory, and file to compare.
[drive2:][path2][filename2] - Specifies target drive, directory, and file to compare.
/Q --> Quite Mode. Do Not display any messages.
/? --> This Help Screen
Errorlevel Return Values:
-1 --> Error
0 --> Files are the same
1 --> Files are NOT the same
2 --> Error Opening filename1
3 --> Error Opening filename2
NOTE: You must enclose the Path/Filename with quotes when using long file names that have spaces in them.
FCOM Test Batch File Usage: TEST.BAT TestFile1 TestFile2
@echo off
cls
Echo FCOM Test Batch
FCOM32 %1 %2 %3 %4 %5 %6 %7 %8 %9
REM To test FCOM.COM place a REM in front of the above line and
REM place an remove the REM from in front of the line below.
REM FCOM %1 %2 %3 %4 %5 %6 %7 %8 %9
IF ERRORLEVEL 3 GOTO ERR3
IF ERRORLEVEL 2 GOTO ERR2
IF ERRORLEVEL 1 GOTO NOTSAME
IF ERRORLEVEL 0 GOTO SAME
IF ERRORLEVEL -1 GOTO ERR1
GOTO ERR4
:ERR1
ECHO Program Error
GOTO END
:ERR2
ECHO ERROR READING FILE 1: %1
GOTO END
:ERR3
ECHO ERROR READING FILE 2: %2
GOTO END
:ERR4
ECHO ERROR: Errorlevel drop through
GOTO END
:SAME
ECHO The File is the same
GOTO END
:NOTSAME
ECHO The File is NOT the same
GOTO END
:END
ECHO Bye..
| Revision History |
| FCOM |
| Version |
Date |
Description |
| 1.0 |
1993 |
Original Release. |
| 1.1 |
24 SEP 04 |
Updated Copyright notice. |
|
|
Added Compiled with feature. |
| 1.2 |
20 APR 04 |
Fix: Improper result when using the /Q switch. |
|
|
|
| FCOM32 |
| Version |
Date |
Description |
| 1.0.0.0 |
1997 |
Original Release. |
| 1.0.0.1 |
10 OCT 01 |
Updated Copyright notice. |
| 1.0.0.2 |
24 SEP 03 |
Added compiled with feature. |
|
|
Updated Copyright notice. |
| 1.0.0.3 |
20 APR 04 |
Removed OS Detection Routine. |
|
|
Updated Copyright notice. |
| 1.0.0.4 |
21 APR 04 |
Replaced OS Detection Routine, updated to detect Windows 2003. |
| Acknowledgments: |
| Franco Massafra |
Finding the Long File Name with spaces issue in FCOM.COM bug. |
| Tim Perley |
Finding improper result when using the /Q switch in FCOM.COM bug. |
Related Downloads