windows Window 的命令行 (cmd.exe) 命令的最大长度是多少?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2966981/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 14:35:05  来源:igfitidea点击:

What is the maximum length of a Window's command-line (cmd.exe) command?

windowscommand-linecmd

提问by Jesse Webb

There are many people asking questionson 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?

有很多人问的问题上SO如何绕过CMD.EXE命令最大长度。我想知道 Windows 命令行长度限制实际上是什么?Windows 版本之间有区别吗?使用 32 位与 64 位版本是否会影响此限制?

回答by Frank Bollack

The first result of asking google about your question was this MS Knowledge Basearticle:

向谷歌询问您的问题的第一个结果是这篇MS 知识库文章:

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.

在运行 Microsoft Windows XP 或更高版本的计算机上,您可以在命令提示符下使用的字符串的最大长度为 8191 个字符。在运行 Microsoft Windows 2000 或 Windows NT 4.0 的计算机上,您可以在命令提示符下使用的字符串的最大长度为 2047 个字符。