CopyPro, Inc.
Home | Products | Resellers | Support | Contact Info Call us at 1(800) 887 - 9906

Detecting Errors

In a batch file (Dos only) you can test for problems using the ERRORLEVEL command. ERRORLEVEL returns only the first number of the error. Since errors involving similar parts of the computer start with the same number, this should be enough to narrow the problem down.

In the example below if the ERRORLEVEL command detects an error it will displays a message based on the error code. ?? Does not display error code.

    @ECHO OFF
    DISKDUPE
    IF ERRORLEVEL=3 GOTO THREE
    IF ERRORLEVEL=2 GOTO TWO
    IF ERRORLEVEL=1 GOTO ONE
    GOTO NOERROR
    :ONE
    Echo Error code 3: Setup error.
    GOTO END
    :TWO
    Echo Error code 2: Disk read error.
    GOTO END
    :ONE
    Echo Error code 1: User escape
    GOTO END
    :NOERROR
    ECHO Error code 0: No errors.
    :END

The errorlevel can also be read from the DISKDUPE.RES file that is created when DiskDupe exits.