I have a Process.Start statement below:
Process.Start("schtasks.exe", @"/Create /SC DAILY /TN" + "\"" + textBox2.Text + "\"" + @"/TR C:\Program Files\test\scanner.exe 'C:\'");
Although I an unable to add speech marks (“) around C:\Program Files\test\scanner.exe without throwing errors.
And also unable to add spaces around textBox2.Text, since the output comes out like:
… /Create /SC DAILY /TNtesting/TR/…..
where “testing” is the textBox2.Text
You have to put double speech marks, like this :
This is how you escape
"in a verbatim string.EDIT: Added space.