Command Prompt for Windows




Command TRACE

Function:

Provide debugging support for batch files.

Syntax:

TRACE [ [drive:][path]filename [batch-parameters] ]
[drive:][path]filenameBatch file name and location.
batch-parametersAny command line information that is used by the batch file.

Note:

When the TRACE command is used to start a specified batch file, then the debugging process begins from the beginning of the batch file.

To specify a point (ie. a break point) within a batch file where the debugging process is to begin, use the TRACE command without any parameters. For example, consider the following batch file :-

@ECHO off
LET total=0
TRACE
FOR %%i is 1 to 10 do {
    LET total=%total% + %%i
}
ECHO sum is %total%

When using the TRACE command, as in the above batch file, there is no need to start the batch file using the TRACE command, instead run the batch file by entering its name at the command prompt. When the WinOne® Command Prompt encounters the TRACE command included in the above batch file, then the debugging process will being from that point.

The use of the TRACE command without any parameters to specify break points is valid only when used within a batch file.

Also see Batch File Debugging.