[C#] Running cmd Commands via Application 06-08-2015, 07:40 PM
#1
Hello there today I will show you how to run cmd commands such as /ipconfig in c#
Let's get started![[Image: smile.png]](http://www.anarchyforum.net/images/smilies/smile.png)
If you have any questions PM me or post below.
Let's get started
![[Image: smile.png]](http://www.anarchyforum.net/images/smilies/smile.png)
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace cmd
{
 public partial class Form1 : Form
 {
  Â
   public Form1()
   {
     InitializeComponent();
   }
   private void button1_Click(object sender, EventArgs e)
   {
    Â
     System.Diagnostics.Process process = new System.Diagnostics.Process();
     System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
    Â
    Â
     startInfo.FileName = "cmd.exe";
     startInfo.Arguments = "/ipconfig"; //Replace ipconfig with any command you may want :P
     process.StartInfo = startInfo;
     process.Start();
    Â
   }
 }
}
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)