Command Line Limitation
Keywords: Command Line Limitation Commandline Limit Parameter
Question:
I use Run ( ... ) for call an extern program that need many arguments. That program is a sound player and I want it play many files.
I see that is possible to use many path names like arguments but ONLY to near 1.2 KB. What is the limit on the number of characters
that can be passed as command line parameters?
Answer:
There are varying limits to the maximum command line length that the CreateProcess() will support depending on what version of Windows you are running.
Furthermore, if you are using ShellExecute(), ShellExecuteEx() or any other wrapper-functions, there the limit might be reduced. Also of interest,
the limits also vary on any given version of Windows depending on whether you are calling the Unicode or ANSI versions of those functions.
Long story made short... Don't try to pass a massive amount of information on the command line. Instead, put it in a file and pass the file name.
If the program is a console program, piping a file to "stdin" may be possible provided that the program is written to read from the
"stdin" channel.
Article ID: W17891
Filename: Command Line Limitation.txt
File Created: 2009:07:29:10:06:18
Last Updated: 2009:07:29:10:06:18