Computing.Net > Forums > Disk Operating System > Max Line Length in a batch file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Max Line Length in a batch file

Reply to Message Icon

Name: Renaissance Man
Date: March 30, 2002 at 04:24:51 Pacific
Comment:

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?



Sponsored Link
Ads by Google

Response Number 1
Name: Doc
Date: March 30, 2002 at 04:45:12 Pacific
Reply:

Check here...

http://www.ericphelps.com/batch/index.htm


0

Response Number 2
Name: Renaissance Man
Date: March 30, 2002 at 05:00:35 Pacific
Reply:

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.


0

Response Number 3
Name: bill 2
Date: March 30, 2002 at 13:27:39 Pacific
Reply:

For what it's worth, I know an echo of 512 bytes works. That's enough for me.


0

Response Number 4
Name: Renaissance Man
Date: March 30, 2002 at 14:09:38 Pacific
Reply:

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.


0

Response Number 5
Name: bill 2
Date: March 30, 2002 at 15:40:27 Pacific
Reply:

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


0

Related Posts

See More



Response Number 6
Name: bill 2
Date: March 30, 2002 at 15:42:21 Pacific
Reply:

Need to add 6 bytes for the @echo and a space


0

Response Number 7
Name: Secret_Doom
Date: March 30, 2002 at 21:50:32 Pacific
Reply:

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


0

Response Number 8
Name: Secret_Doom
Date: March 31, 2002 at 19:31:13 Pacific
Reply:

BTW, here are the PLAIN values:

DOS 6.22: 127 characters/bytes
DOS7 (Win9x/ME): 1024 characters/bytes

As simple as it gets =D

-- Secret_Doom - Leonardo Pignataro --

secret_doom@hotmail.com
www.batch.hpg.com.br


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Max Line Length in a batch file

length of a string in a batch file www.computing.net/answers/dos/length-of-a-string-in-a-batch-file/13650.html

want specify enter in a batch file www.computing.net/answers/dos/want-specify-enter-in-a-batch-file/14558.html

What is >nul mean do in a batch file www.computing.net/answers/dos/what-is-nul-mean-do-in-a-batch-file/197.html