[ Back to Table of Contents ]
[ << ]
[ >> ]
XXCOPY TECHNICAL BULLETIN #31
From: Kan Yabumoto tech@xxcopy.com
To: XXCOPY user
Subject: XXCOPY's Exit Code (for ERRORLEVEL checking)
Date: 2004-09-09 (revised)
===============================================================================
Introduction:
Upon the completion of execution, Windows (and DOS) programs return
a 16-bit value (8-bit value in DOS) to the parent process. XXCOPY
is of no exception. The value is usually referred to as Exit code
which is also widely known as the ERRORLEVEL value in batch file
programming. Due to the DOS compatibility, the batch program can
examine only the low order 8-bit value (0 - 255) for testing. The
exit code provides a mechanism to evaluate the result of the program
execution which can be incorporated in a conditional branch operation
(for IF ERRORLEVEL n GOTO ...).
For related topics on batch file technique, see, XXTB #19.
XXCOPY's standard exit codes:
Exit Code Comment (in default mode with /ER0)
---------------------------------------------------------
0 No error, Successful operation
1-32 Reserved
33 Aborted by user
34 Illegal command parameter
35 Invalid DOS version
36 The current directory is invalid
37 Resident DATMAN wrong version
38 Cannot create the destination directory
40 Some fatal error has occurred
41 Invalid source specifier
42 Invalid destination specifier
43 Invalid exclusion item specifier
44 Disk Full
45 Share violation error
46 Conditional termination
47 Path name exceeds the file system's limit
48 Cannot overwrite read-only file
49 Problem in network
100 No files were found to copy
101-254 # errors in file copy (1-154, biased by 100)
255 # errors exceeding 154 files
XCOPY-compatible exit codes:
Exit Code Comment (in XCOPY-compatible mode with /ER)
---------------------------------------------------------
0 No error, Successful operation
1 No files were found to copy
2 Aborted by user
4 Disk Full, command syntax error, etc.
5 Disk write error.
The Built-in Exit Code Help:
The error code tables shown above are also available as a
built-in Help text by running the following switch.
XXCOPY /HELPE
© Copyright 2012 Pixelab All rights reserved.