How can I pass Argument to the System.Dignostics.Process with spaces. I am doing this:
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents = false;
proc.StartInfo.FileName = exePath + @"\bin\test.exe";
string args = String.Format(@"{0}{1}{2}{3}", "-plot " ,path1, " -o ", path2);
proc.StartInfo.Arguments = args;
when path1 and path2 do not contain spaces ( Let's say path1 = C:\Temp\ and path2 = C:\Temp\Test) then it works fine, but when path1 and path2 contain spaces for example path1 = C:\Documents and Settings\user\Desktop and path2 = C:\Documents and Settings\user\Desktop\New Folder) then it trucates the path1 and path2 and abort.
Please let me know the correct way for doing this.
Thanks, Ashish