Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
As basic as this should be, I don't know the maximum line length permissible in a batch file. On a command line I know its 127 characters, and I know it's longer in a batch file. Can you help?

Tons of info there. Couldn't find an answer.
The answer I looking for is a number, not a place to go to to find a number.

I never thought of using echo to test this! The line length for echo is over 300 characters (WinME--is that DOS 7?), but it depends on whether they are spaces or Ascii characters! I found a MS KB article (Q69563) that said thru DOS 6.2 the line length max was 127 characters. So:
* Does DOS 7 differ from DOS 6.2 in this regard?
* Is the echo command a valid way of testing the length of a DOS command? (E.g., if I use
for %%z in (a b c d e f g) do del %%z the path/file names for a, b, c,... can get quite long.

I tried it in DOS 7.0 via a qbasic program to echo a line 1024 bytes long and it truncated around 1012. In 6.22 it truncates at 122

1. Is WinME Dos7?
Yes. WinME is actually Win98 a little bit modifyed (they've added some extra bugs hehe)2. Does the max line length differ from Dos6.22 to Dos7?
Yes, it does. I believe the max line length (I'll be refeering to that as "MLL") on a batch on Dos6.22 would be the same as the MLL of the command prompt. And I think the MLL on batch on Dos7 is the MLL of a text file (1024, like bill said)Keep in mind that lines with variables may have different sizes at different computers.
HTH
-- Secret_Doom - Leonardo Pignataro --
secret_doom@hotmail.com
www.batch.hpg.com.br

BTW, here are the PLAIN values:
DOS 6.22: 127 characters/bytes
DOS7 (Win9x/ME): 1024 characters/bytesAs simple as it gets =D
-- Secret_Doom - Leonardo Pignataro --
secret_doom@hotmail.com
www.batch.hpg.com.br

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |