FOR cannot be nested

Microsoft MS-DOS

Severity: Minor

What it means

A FOR command contains another FOR command.

Affected Models

  • IBM PC compatibles running MS-DOS

How to Fix It

  1. Rewrite the FOR commands in your batch file to avoid nesting.

  2. Put the inner FOR into a second batch file, and start that one from the first FOR.

    MS-DOS 3.3 and later have CALL for it.
    Before that: COMMAND /C and the file's name.