Login Register


[C#] Running cmd Commands via Application filter_list
Author
Message
[C#] Running cmd Commands via Application #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]

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();                 }   } }
If you have any questions PM me or post below.

Reply





Messages In This Thread
[C#] Running cmd Commands via Application - by Travis - 06-08-2015, 07:40 PM



Users browsing this thread: 1 Guest(s)