Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

ProcessStartInfo Argument with whitespaces

$
0
0

Hello

I'm using the ProcessStartInfo class to start a cmd line application.  I know it works, but when one of the arguments i pass had a whitespace in the path, it isn't working.

Here is the code I'm using.  The SVN url is

http://svn/ApplicationCode/SandBox/Tags/Version/2013/12-06-2013 1018

string mystr = string.Format("{0}"+ svnUrl+"{1}", '"', '"');
var process = new ProcessStartInfo("cmd.exe", "/C " + "svn checkout " + mystr +  " c:\\Temp\\" + selectedTag);
process.CreateNoWindow = true;
process.UseShellExecute = false;
process.RedirectStandardOutput = true;
  using (Process pcess = Process.Start(process))
    {
      using (StreamReader reader = pcess.StandardOutput)
      {
        result = reader.ReadToEnd();
       }
   }

from the cmd line I can get this to work if I add quotes

svn checkout "http://svn/ApplicationCode/SandBox/Tags/Version/2013/12-06-2013 1018" c:\Temp\jnk

Thanks


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>