I am trying to pass two directory paths via the command line to a C# application. These paths will likely contain spaces, and given that C# populates args[]
by splitting across spaces, this is giving me problems.
What I tried was passing the paths wrapped in quotes, like this:
myprogram.exe "C:\aa a\bbb\" "C:\ppp\ll l\"
..this, however, creates a problem because the backslash at the end of each path is being interpreted by C# as an escape character, so it is parsing the double quote as well. When I run the app with these argurments, args[] contains only one entry:
C:\aa a\bbb" C:\ppp\ll l"
The easy solution would be to only enter directory paths without the final backslash, but it is not optimal and will likely frustrate users of the program.
Is there an easy solution to this?