"If at first you don't succeed; call it version 1.0" :-Unknown

Pages

Tuesday, October 12, 2010

run command promt command in asp.net

hi,
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: