This article was previously published under Q69563
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
This article contains information on the maximum number of lines and linelength allowed for batch files (including the AUTOEXEC.BAT file) and theCONFIG.SYS file.
There is no apparent limit. A test batch file with 67,000 lines and a totalof 804,000 bytes ran all the way through (but it took 15 minutes to do soon a 386/33 machine). COMMAND.COM reads one batch line at a time, and onlyretains a file pointer for the batch file, so it does not require a largebuffer to hold batch file commands before processing them. This shouldallow for batch files that span an entire disk, if so desired.
Each batch file line does have a limit, however. Any batch file lineexceeding 127 bytes is truncated at 127 bytes before it is processed.
There is no limit on lines, but there is a 64-kilobyte (65,534 byte) limiton 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 devicedriver) loaded properly. There do appear to be some problems on theboundary condition when the CONFIG.SYS file size reaches 65,535 bytes.
Each CONFIG.SYS line does not appear to have a limit. The device driverINIT code is given a pointer to a read-only buffer, which contains theremainder of the CONFIG.SYS file, not just the command line. With thispointer, you can access a command line of any length.