Skip to content

Open cmd.exe on button click using IIS Server .

indramani gautam

Asked Apr 17, 2012, 1:21 AM EDT2 answers
Share
LinkedInX
How to open cmd.exe on button click using IIS Server .

I know,

Process.Start("cmd.exe");

Thanks

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Senthilkumar
    0
    Hi Indramani,

    Try this...

    System.Diagnostics.ProcessStartInfo procStartInfo =
    Java
            new System.Diagnostics.ProcessStartInfo("cmd", "/c " + command);
    
    
        // The following commands are needed to redirect the standard output.
        // This means that it will be redirected to the Process.StandardOutput StreamReader.
        procStartInfo.RedirectStandardOutput = true;
        procStartInfo.UseShellExecute = false;
        // Do not create the black window.
        procStartInfo.CreateNoWindow = true;
        // Now we create a process, assign its ProcessStartInfo and start it
        System.Diagnostics.Process proc = new System.Diagnostics.Process();
        proc.StartInfo = procStartInfo;
        proc.Start();
        // Get the output into a string
        string result = proc.StandardOutput.ReadToEnd();
    0
  • 0
    Sorry Senthil kumar This code not working
    0