Article ID: 69563 - View products that this article applies to.
This article was previously published under Q69563
This article contains information on the maximum number of lines and line length allowed for batch files (including the AUTOEXEC.BAT file) and the CONFIG.SYS file.
Batch FilesThere is no apparent limit. A test batch file with 67,000 lines and a total of 804,000 bytes ran all the way through (but it took 15 minutes to do so on a 386/33 machine). COMMAND.COM reads one batch line at a time, and only retains a file pointer for the batch file, so it does not require a large buffer to hold batch file commands before processing them. This should allow for batch files that span an entire disk, if so desired.
Each batch file line does have a limit, however. Any batch file line exceeding 127 bytes is truncated at 127 bytes before it is processed.
CONFIG.SYS FileThere is no limit on lines, but there is a 64-kilobyte (65,534 byte) limit on the overall file size. A test with a CONFIG.SYS that contained only 76- byte long REM statements (except for the last line, which loaded a device driver) loaded properly. There do appear to be some problems on the boundary condition when the CONFIG.SYS file size reaches 65,535 bytes.
Each CONFIG.SYS line does not appear to have a limit. The device driver INIT code is given a pointer to a read-only buffer, which contains the remainder of the CONFIG.SYS file, not just the command line. With this pointer, you can access a command line of any length.
Article ID: 69563 - Last Review: May 12, 2003 - Revision: 2.0