PHP exec() function maximum character length

abgtemp used Ask the Experts™
I'm running an executable and passing a couple of argument to it using PHP's exec() function on a 2003 Windows server. I was wondering what is the maximum number of characters than can be passed. Depending how low the number is, is there a way to increase the limit?

exec(myprogram.exe "arg1" "arg2");
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
the first parameter of the exec command is a string variable so the function exec will take whatever you give it, there really is no limit. The limit that windows can use via a command line argument is: 8191 characters according to this article from microsoft. So I would guess that the length of the command argument you could use could not exceed 8191 characters.


Thanks. I'm bumping the point up for the quick response.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial