I am opening cmd.exe from my application and navigating it to a file but the problem is that if the file path has spaces in it, it won’t go there.
Process.Start("cmd.exe", "/C choice /C Y /N /D Y /T 3 & cd C:\Temp Folder");
Instead for looking of Temp Folder, it will only look for temp I guess.
One way is to wrap the path with ” ” but I can’t do it in a string. (tried ‘ ‘)
Another way is to loop through the path, find spaces and replace them with something, but I don’t know with what.
I could use some help with either of this ways (if you have a better one, that’s great)
The
\in the string needs to be escaped and you need to include folder names with space in double quotes.Try
or