Specifying System.Diagnostics.Process.Start parameters with spaces in a parameter string
Posted on 2006-05-01
I have a C# application that calls a process from the C# code.
One of the parameters is a filepath. This works fine - as long as there are no spaces in the filepath. If there are spaces in the filepath name, the app breaks.
For example, this works:
System.Diagnostics.Process.Start("c:\\Programs\\WinRar\\WinRar", "e c:\\Temp\\*.rar *.rcp");
This, however, does not work (notice that the only difference is that there is a space in the filepath string in the second argument):
System.Diagnostics.Process.Start("c:\\Programs\\WinRar\\WinRar", "e c:\\Temp Files\\*.rar *.rcp");
Thanks in advance,