I'm trying to pass a filename to a cmd prompt. Ive looked various places but cant seem to find the answer - I'm sure its simple.
My string is built like so:
string cmd = string.Format(@" -u{0} -p{1} -h{2} -P{3} {4} < ""{5}""",
user, pass, server, port, database, filename);
However the result is a string like so:
-uuser -ppass -hhost -P1234 database < \"C:\\my file.sql\"
How do i remove the \ before and after the filename? Its causing the process to run with a file cannot be found error.
My string needs to be:
-uuser -ppass -hhost -P1234 database < "C:\\my file.sql"
EDIT: OK, disregard this question.. there is something else goind on with process.start();