Instructions for using the MSDOS version of CRC32



Click here to download the file CRC32DOS.EXE (53K).

Syntax:

CRC <options><filespec>

Valid options:

'-c' - ignore any CR characters in files

'-d' - recurse directories specified by filespec (when wildcards are used)

Ex: CRC -d D:\PC* will CRC all files in directory names matching PC* on drive D:\

'-l' - print the output in lowercase

'-r' - don't recurse through sub directories

'-s' - sort the output (defaults to lowercase output)

Note: The '-r' option will override '-d'

Behavior of program:

The default behavior of the CRC program is to begin processing at the directory where the program was executed unless specified in the filespec on the command line.

General samples:

CRC FILE1.TXT

This will perform a CRC check on the file FILE1.TXT that is located in the current directory.

CRC FILE1.TXT FILE2.TXT

This will perform a CRC check on the files FILE1.TXT and FILE2.TXT, which are located in the current directory.

CRC C:\*

This will perform a CRC check on every file located in the C: drive, starting at the root directory.

This format allows you to enter multiple filespecs.


Sample output using the options:

Option '-l' for displaying output in all lowercase characters

If you want the output to be displayed in all lowercase characters, then use the '-l' option. This is a sample without the option:

    CRC C:\*.TXT  

    CRC 32     File Size   Filename
    ------------------------------------------------- 
    d187177e         6064   c:\FRUNLOG.TXT 
    c68b248d         6790   c:\FACLOG.TXT 
    92598e18          545   c:\pbi.txt

This is a sample with the '-l' option:

    CRC -l C:\*.TXT  

    CRC 32     File Size   Filename
    ------------------------------------------------- 
    d187177e         6064   c:\frunlog.txt 
    c68b248d         6790   c:\faclog.txt 
    92598e18          545   c:\pbi.txt

Option '-c' for ignoring MSDOS carriage return characters (CR) in files

This option is especially useful for comparing files that originated from a Unix platform that were copied onto a MSDOS filesystem. The "return" used by MSDOS is CRLF, while Unix only uses LF. When this option is used, the extra "CR" character (ASCII code 13) is ignored.

This option is strongly recommended if you don't know where the files you are comparing originated from. If you copy a file from a CD that was created on Unix to an MSDOS system, the files will be identical, but the LF characters will be converted to CRLF.

This is a sample, comparing two files. One is the file that was installed to the local MSDOS system, which the other file originated from a Unix platform. Although the files are actually identical, the extra "CR" characters cause this to fail the checksum because the file sizes will be different:

    CRC DOS.M UNIX.M  

    CRC 32     File Size   Filename
    ------------------------------------------------- 
    0e579d83          365   D:\Dev\crc32\dos.m 
    c267c328          356   D:\Dev\crc32\unix.m

Using the '-c' option fixes this problem. The file sizes will still be reported as different, but the files will have the same CRC because the extra characters were ignored:

    CRC -c DOS.M UNIX.M  

    CRC 32     File Size   Filename
    ------------------------------------------------- 
    c267c328          365   D:\Dev\crc32\dos.m 
    c267c328          356   D:\Dev\crc32\unix.m

Option '-s' for sorting the output

If you want the output to be sorted, which is very useful for complex hierarchies or when you have a lot of files to examine. All of the output will be in lowercase. This is a sample without the option:

    CRC C:\*.TXT  

    CRC 32     File Size   Filename 
    -------------------------------------------------
    d187177e         6064   c:\FRUNLOG.TXT 
    c68b248d         6790   c:\FACLOG.TXT 
    92598e18          545   c:\pbi.txt

This is a sample with the '-s' option:

    CRC -s C:\*.TXT 

    CRC 32     File Size   Filename
    -------------------------------------------------
    c68b248d         6790   c:\faclog.txt 
    d187177e         6064   c:\frunlog.txt 
    92598e18          545   c:\pbi.txt

Option '-r' to prevent the program from performing directory recursion when looking for files

This is a useful option when you are comparing files at the root of a complex hierarchy, but don't want the program to search for each file in every subdirectory. Here's an example, where we want to perform a CRC check on every file located in the D : root directory:

    CRC D:\  

    CRC 32     File Size   Filename 
    -------------------------------------------------
    aac454d0       147456   d:\ffastun.ffl 
    157fd737       696320   d:\ffastun0.ffx
    68c9d3a1       528384   d:\ffastun.ffo 
    d2e92df0         4379   d:\ffastun.ffa 
    d5935680          105   d:\INSTALL.LOG 
    a83a68e9         1370   d:\chi_yahoo.txt 
    381b09e4      1821129   d:\DOOM2\2SPOOK35.WAD  
    2f71ff8a           97   d:\DOOM2\772.BAT 
    4ec75c1b           97   d:\DOOM2\773.BAT 
    6a9e3022           99   d:\DOOM2\7734M.BAT 
    . . . more files....

This isn't what you wanted. If the '-r' option is used, then only the files at the root directory of D:\ will be searched. Any subdirectories under D:\ will be ignored. Here's an example:

    CRC -r D
:
    CRC 32     File Size   Filename
    -------------------------------------------------
    aac454d0       147456   d:\ffastun.ffl 
    157fd737       696320   d:\ffastun0.ffx 
    68c9d3a1       528384   d:\ffastun.ffo 
    d2e92df0         4379   d:\ffastun.ffa 
    d5935680          105   d:\INSTALL.LOG 
    a83a68e9         1370   d:\chi_yahoo.txt

Option '-d' to recurse all subdirectories that match the wildcard filespec

This option is required if you want to perform a CRC checksum on files that match a wildcard filespec. If this option isn't used, then the program will only search for files that match the wildcard filespec, which is the default behavior.
Here's an example, where we want to perform a CRC checksum on all files in subdirectories matching the Z* wildcard filespec:

    CRC -d D:\Z*  

    CRC 32     File Size   Filename 
    -------------------------------------------------
    9236af56       746882   d:\zip\nottab.zip 
    6d4178e3       130027   d:\zip\prntky.zip
    78326393       666293   d:\zip\wsftp.zip 
    a27c03ac      1345683   d:\zip\wintun.zip
    2f7bf5c7      5743171   d:\zip\pbi32_3.exe
    b6fc3ff4      2520456   d:\zip\PWX95.EXE 
    169d3324      2626635   d:\zip\qteasy32.exe
    58e8d67b       135706   d:\zip\wzspnb32.exe
    8e8b9cae         7582   d:\zddesktop\ZDDESK.TXT
    436af461        56558   d:\zddesktop\DESK_SRC.ZIP
    95d6dd42        22327   d:\zddesktop\ZDDESK.HLP

Without the '-d' option, this would be the output. Notice that only files and subdirectories matching the wildcard filespec will be displayed:

    CRC D:\Z*  
   
    CRC 32     File Size   Filename
    ------------------------------------------------- 
    d5763d90       156228   d:\zip\ZDDESK.ZIP 
    8e8b9cae         7582   d:\zddesktop\ZDDESK.TXT 
    95d6dd42        22327   d:\zddesktop\ZDDESK.HLP 
    38700249          406   d:\zddesktop\ZDDESK.CNT 
    b5c76eec       223744   d:\zddesktop\ZDDESK.EXE 
    eaa8e392        10825   d:\zddesktop\ZDDESK.GID

Advaned options and techniques:

Multiple arguments

You can use multiple arguments on the command line. This example will recurse through two directories: CRC32DOS C:\TEMP D:\TEMP

The results from D:\TEMP will be appended to the output from C:\TEMP.

Using different options for multiple arguments

This is a very useful feature when you may want to perform recursion on one subdirectory tree while only performing a checksum on files in a directory. The following example will perform a full subdirectory recursion (with lowercase output) on the C:\WINDOWS directory, and only checksum the files in the D:\TEMP directory: CRC32DOS -l C:\WINDOWS -r D:\TEMP

Any options flags encountered before a filespec will override the previous options specified. In this case, the output for the D:\TEMP directory won't be in lowercase because the 'l' option wasn't specified.

You can also simply erase all option flags by simply using a dash, like in this example:

CRC32DOS -l C:\WINDOWS - D:\TEMP

A full subdirectory recursion will be performed on the D:\TEMP directory, and the output won't be in lowercase.