// Shell command to create a video
Public static bool internal control (string cmd)
{
Bool flag = false;
Process proc = new process ();
Try
{
Proc. startinfo. filename = "cmd.exe ";
Proc. startinfo. useshellexecute = false;
Proc. startinfo. redirectstandardinput = true;
Proc. startinfo. redirectstandardoutput = true;
Proc. startinfo. redirectstandarderror = true;
Proc. startinfo. createnowindow = true;
Proc. startinfo. useshellexecute = false;
Proc. Start ();
Proc. standardinput. writeline (CMD );
Proc. standardinput. writeline ("exit ");
While (Proc. hasexited = false)
{
Proc. waitforexit (500 );
}
String pingresult = Proc. standardoutput. readtoend ();
If (pingresult. indexof ("command completed successfully ")! =-1 | pingresult. indexof ("deleted ")! =-1)
{
Flag = true;
}
Proc. standardoutput. Close ();
}
Catch (exception ex)
{
}
Finally
{
Try
{
Proc. Close ();
Proc. Dispose ();
}
Catch
{
}
}
Return flag;
}