I am concatenating video files of mpg format using the ‘Copy’ command in command prompt programatically in C#. I am able to execute the command manually in the command prompt and it works perfectly.
Copy /b D:\\ccc\\out0.mpg /b + D:\\ccc\\out1.mpg /b D:\\ccc\\bMPGVideo.mpg /b
But when i execute the same command programmatically, it throws an error.
strCmdText = "/K Copy /b D:\\ccc\\out0.mpg /b + D:\\ccc\\out1.mpg /b D:\\ccc\bigMPGVideo.mpg /b";
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.FileName = "CMD.exe";
p.StartInfo.Arguments = strCmdText;
p.StartInfo.RedirectStandardError = true;
p.Start();
MessageBox.Show(p.StandardError.ReadToEnd());
The message box shows the follwing message
The handle is invalid
The filename, directoryname or volume label is invalid
The handle is invalid
The handle is invalid
Can someone please help me with this?
D:\\ccc\bigMPGVideo.mpgshould beD:\\ccc\\bigMPGVideo.mpg.EDIT – as per comments: