Page 1 of 1

C# question

Posted: Sun Mar 16, 2008 11:47 am
by Andrew_b
Im working on programming with some use from the command prompt...

I want my program to tell command prompt to move something somewhere and the code in cmd uses "" for the paths...and in C# if i try to type "" for the coding, it thinks im stopping my text.

Code: Select all

System.Diagnostics.Process.Start("cmd.exe", @"/c MD "path" "path to move"");
thats my code

Posted: Sun Mar 16, 2008 11:51 am
by Anthony
to use a " just simply put a \ before it so it should look like this

\"

Posted: Sun Mar 16, 2008 11:57 am
by Andrew_b
thanks!

Posted: Wed Apr 02, 2008 10:26 pm
by mrbuckaroo
In case you ever need to google for the concept it is called an "escape character".

Posted: Wed Apr 02, 2008 10:40 pm
by Andrew_b
I'll keep that in mind. Thanks!