How To Execute Command in C#
How To Execute Command in C#
using System;
using System.Threading;
namespace ExecuteCommand
command = Console.ReadLine().Trim();
// Execute the command synchronously.
exe.ExecuteCommandSync(command);
exe.ExecuteCommandAsync(command);
Console.WriteLine("\nDone !");
Console.ReadLine();
/// <summary>
/// </summary>
try
procStartInfo.RedirectStandardOutput = true;
procStartInfo.UseShellExecute = false;
procStartInfo.CreateNoWindow = true;
proc.StartInfo = procStartInfo;
proc.Start();
Console.WriteLine(result);
/// <summary>
try
objThread.IsBackground = true;
objThread.Priority = ThreadPriority.AboveNormal;
objThread.Start(command);
}
}
#endregion
P O S T E D B Y S A N D E E P A PA R A J I T AT