How to pass a string with spaces in it as start arguments for a program
c#, process
Solution
Wrap the argument in double quotes:
"c:\My Folder\some.exe" /a="this is an argument"
As a string passed to Process.Start:
process.StartInfo.Aguments = "\"this is an argument\"";
Check out this post & answer for more details.
Problem
I have a console project which I want to start with some parameters `argc`. I want to pass to it a path from my computer, let's say `C:\\My Folder`. How can I pass the spaces? When I try to read it I obtain something like `C:\\My`. I've read that I can pass them by using `"`. If so, how can I pass those to a string (`"C:\My Folder"`) because I am start this program by using the `Process.Start` and `ProcessStartInfo` commands?