This is .NET 2.0 WinForms. I have some code like so
string str = Path.GetTempFileName();
Process p = new Process();
ProcessStartInfo psi = new ProcessStartInfo();
psi.Arguments = str
psi.FileName = <some executable >
p.StartInfo = psi;
p.Start();
Now on the "started" process I get the temp file name by saying args[0]
. On Win XP this is causing an issue as the temp file is in C:\Documents and Settings\...
.
The space is causing an issue, thus args[0]
is C:\Documents
.
How can I fix this? Do I just have to place str
in quotes? Or can I get the whitespace to be ignored somehow?