1

similar question was already asked here.
tried setting useShellExecute = false / true. it made no effect!
i just wanted to delete the original file after conversion.. when i run the following command through command prompt in windows there is no issue

ffmpeg.exe -y -i D:\old.avi D:\new.avi && D:\del D:\old.avi

but if i run the same command from System::Diagnostics::Process ^process, ffmpeg shows error

unable to find suitable format for '&&'
&&: invalid aurgument

following command as an argument gives no error at System::Diagnostics::Process ^process

 -y -i D://old.avi D://new.avi

is there a way to pass 2 commands in one go? like in command prompt?

below is my code in c++/cli

String ^location = System::Reflection::Assembly::GetEntryAssembly()->Location;
String^ ExecutableDirectory = System::IO::Path::GetDirectoryName(location);
System::Diagnostics::Process ^process = gcnew System::Diagnostics::Process();
System::Diagnostics::ProcessStartInfo^ startInfo = gcnew System::String^ Arguments = "-y -i D://old.avi D://new.mp4 && del D://old.avi"; 
System::Diagnostics::ProcessStartInfo(ExecutableDirectory+"//ffmpeg.exe", Arguments);
startInfo->WindowStyle = System::Diagnostics::ProcessWindowStyle::Maximized;
process->StartInfo = startInfo;
process->Start();

Thanks

Community
  • 1
  • 1
Prakash M
  • 659
  • 1
  • 12
  • 36

0 Answers0