CMD command string limit - 2047 bytes

G

Guest

Hi all,
I've read a MS article ( Article ID: 830473 ) that CMD is limited to 2047
bytes; that limit works when i type all those characters in a CMD window. It
also worked when a legacy app uses CMD to run a command (it was about 4
months).

Server and client stations have always been W2K SP4, with all critical
updates installed until today...

But now, the same legacy app can issue a 4060-byte lon command string with
no problem!!!!
Does any one of you geniuses know if it's been modfied in a W2K
update/service pack?
I made some chages/restrictions into my app based on 2047 limit and now i
have to explain why thaty limit has benn iincreased!!!!
Help PLease!!!
Thanks
 
J

John John

The article says that the limit is 2047 *characters* , it says nothing
about *byte* length. If you are using 8-bit character set then the
limit would fall at 2047 bytes but if you use 16-bit character set then
the limit, byte wise would be twice as much. It doesn't say anything in
the article about single or double byte characters, nor the length byte
wise. I can only assume that Microsoft took that into consideration
when they designed it, if not our Asian friends would be limited to a
length of 1023.5 characters...

John

John
 
G

Guest

John John, thanks for your answer.
OK, i admit it, i'm "mixing" two thigs in one. When i say "bytes", i mean
"characters". All the description refers to a string length (number of
characters).
But the question reamins: "Have MS changed the limit for CMD command-line
string length for Win 2K?"

Thanks again
 
J

John John

I don't know, someone else might have an answer. Someone could always
test with a maximum string length and find out, maybe:

echo 12345678901234567890123456789012345678901234567789012....

John
 
G

Guest

Thanks for your time....

John John said:
I don't know, someone else might have an answer. Someone could always
test with a maximum string length and find out, maybe:

echo 12345678901234567890123456789012345678901234567789012....

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top