Folks,
I have a simple expression that I am able to run by pasting it in the "search program and files" :
"C:\Program Files (x86)\notepad.exe" /BF: "D:\BatchMerge\DcaBatch.bpf"
If I have use the same expression in the C# code, what should I use? I searched on stackflow and found "Process.startinfo"
. I tried using it as below:
Process.Start(""C:\Program Files (x86)\notepad.exe" /BF: "D:\BatchMerge\DcaBatch.bpf"");
That does not work!
Answer
You should separate the executable from the arguments. Look at this overload. So you'd do this instead:
Process.Start(@"C:\Program Files (x86)\notepad.exe", "/BF: \"D:\\BatchMerge\\DcaBatch.bpf\"");
No comments:
Post a Comment