There are many people asking questions on SO about how to get around the cmd.exe command maximum length. I was wondering what actually is the Windows command-line length limit? Is it different between version of Windows? Does using a 32-bit vs. a 64-bit version affect this limitation?
Asked
Active
Viewed 9,708 times
6
-
possible duplicate of [Maximum Length of Command Line String](http://stackoverflow.com/questions/3205027/maximum-length-of-command-line-string) – p.s.w.g Apr 24 '13 at 20:03
1 Answers
14
The first result of asking google about your question was this MS Knowledge Base article:
On computers running Microsoft Windows XP or later, the maximum length of the string that you can use at the command prompt is 8191 characters. On computers running Microsoft Windows 2000 or Windows NT 4.0, the maximum length of the string that you can use at the command prompt is 2047 characters.

Michael Mrozek
- 169,610
- 28
- 168
- 175

Frank Bollack
- 24,478
- 5
- 49
- 58
-
It seems like Windows version DOES matter when it comes to the limit but 32 bit vs. 64 bit does not make any difference. – Jesse Webb Jun 04 '10 at 14:16
-
3Side note: This also affects how long strings in environment variables can be when working with them in batch files. – Joey Jun 11 '10 at 01:07