Omar El-elamy Omar El-elamy - 4 months ago 38
C# Question

File Path with spaces in process writeline

i wanted to ask a question related to passing a file path with spaces in the cmd... i have this statement that i want to execute

nunit3-console.exe "E:/folder 1/folder2"

i want to know how can i put double quotes to the file path as folder 1 has white space in between.. i'm using now

process.StandardInput.WriteLine("nunit3-console.exe E:/folder1/Report_Testing.dll");

this works if the folder doesn't have spaces.. what is the solution to execute the above command with " " .. Thanks in advance

Jon Jon

If you put a backslash before a double quote then a double quote will be included in the string.


process.StandardInput.WriteLine("nunit3-console.exe \"E:/folder1/Report_Testing.dll\"");

Refer to for more information.