Specify command for the CMD to open

Asked

Viewed 1,158 times

2

I am making a simple program with Visual Studio to run some commands on CMD that I want, currently the program has only a simple screen and a button to open cmd, but I would like to specify the command that the prompt should run.

Ex: Ipconfig, flushdns, etc.

Currently my code is like this, using the System.Diagnostics

namespace Comands 
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Process.Start("CMD.exe");
        }
    }
}

1 answer

2


Browser other questions tagged

You are not signed in. Login or sign up in order to post.