Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques unable to delete original file through c++/cli

  • unable to delete original file through c++/cli

    Posted by Prakash Choudhary on December 23, 2015 at 8:23 pm

    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

    Prakash Choudhary replied 10 years, 6 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy