var proc1 = new ProcessStartInfo();
string anyCommand="your command";
proc1.UseShellExecute = true;
proc1.FileName = @"C:\Windows\System32\cmd.exe";
proc1.Arguments = "/c " + anyCommand;
proc1.WindowStyle = ProcessWindowStyle.Hidden;
var process=Process.Start(proc1);
process.WaitForExit();
if (process.ExitCode != 0)
{
MessageBox.Show("Error");
}