Process & CMD: Not Accepting Programs with Parenthesis

  • Thread starter Thread starter hfaun
  • Start date Start date
H

hfaun

Guest
I am trying to execute a program that has parenthesis in the program name, e.g. a program like "append(-k).exe" or "exiftool(-k).exe". So I am setting this up like:

Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.CreateNoWindow = false;
startInfo.FileName = "cmd";
startInfo.Arguments = "/k" + "\"append(-k).exe\"";
startInfo.WorkingDirectory = "C:\\append\\Release";
startInfo.UseShellExecute = true;
process.StartInfo = startInfo;
process.Start();
process.WaitForExit();

When I execute this I get the err: 'append is not recognized as an internal or external command, operable program or batch file. When I go to a regular DOS prompt and execute append(-k).exe I get the same error. However, when I put it in quotation mark, i.e. "append(-k).exe" it works as expected. So I also tried to add the quotation marks to startInfo.Argument as can be seen with the \". However, I still get the same errors as if the quotation marks were not there. Why does this happen?

Continue reading...
 

Similar threads

S
Replies
0
Views
148
sakulkarni83
S
A
Replies
0
Views
114
Andrei-Eduard Lica
A
M
Replies
0
Views
125
MarvelousSoftware
M
L
Replies
0
Views
161
LavaCreeperKing
L
Back
Top