alternatives to System.Diagnostics.Process.Start when command is too long

Posted by Frank Schwieterman on Stack Overflow See other posts from Stack Overflow or by Frank Schwieterman
Published on 2010-05-19T23:49:35Z Indexed on 2010/05/20 3:20 UTC
Read the original article Hit count: 391

Filed under:

I have some code which is generating a rather long command that is being sent to System.Diagnostics.Process.Start(). The call fails with a Win32Exception, message "The filename or extension is too long". The path to the program itself is not very long, but the parameters passed in are quite long. I am calling the version where an instance of ProcessStartInfo is passed as the parameter, and in this case its the ProcessStartInfo.Arguments .Field that is very long. (other parameters: CreateNoWindow = true, UseShellExecute = false, RedirectStandardError = true).

It looks like the exception is coming from a call to win32 function CreateProcess.

Does anyone have an idea of another way to start the process?

© Stack Overflow or respective owner

Related posts about system.diagnostics