As a part of my current project i need to run command promt command in asp app.it's nice i'm sharing the code here
System.Diagnostics.ProcessStartInfo si = new System.Diagnostics.ProcessStartInfo("cmd.exe");
si.RedirectStandardInput = true;
si.RedirectStandardOutput = true;
si.RedirectStandardError = true;
si.UseShellExecute = false;
si.CreateNoWindow = true;
si.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
System.Diagnostics.Process console = System.Diagnostics.Process.Start(si);
console.StandardInput.WriteLine(" *** Your command Comes Here*** ");
Hope it helped u someways
Have a nice day... 'N happy Coding :)
No comments:
Post a Comment