Ever wondered what the maximum length of a command line param to a .NET application is?
I am investigating simple integration options between processes and wanted to know the limitation of this method of passing info from one process to another.
I found some documentation on MSDN (http://msdn.microsoft.com/en-us/library/ms682425(VS.85).aspx) which states that the max commandline param could be 32,768 characters.
So then I put together this .NET app to test that:
You can specify the length of data that you want passed to the other process.
The code that launches the other process looks like this:
And then I modified the other application’s Program.cs file as follows:
The result of this test?
I can pass 32,673 characters to the other process. Which is 5 fewer characters than the API call allows. (4 if you subtract the null terminator on the string).
Does anyone know where the additional 4 characters have gone?