Hỏi Code để chạy lệnh CMD trong C#

Có Code nào mà có thể chạy được lệnh CMD khi Click vào Button không ạ? Tức là khi Tick vào RadioButton và Click vào Button thì nó sẽ chạy Code đó và mỗi RadioButton thì nó sẽ chạy Code khác không ạ?
 
Nếu thích thì nén nó vào hàm, khi event click button chỉ cần gọi hàm ra dùng

Mã:
// khai bao lop thu vien
using System.Diagnostics;


           // khoi tao tien trinh
            Process process = new Process();


            // thiet lap thong so tien trinh
            process.StartInfo.FileName = "cmd.exe"; // đường dẫn chương trình
            process.StartInfo.Arguments = "/k {duong dan file cmd/bat hoac lenh cmd}"; // tham so
            process.StartInfo.UseShellExecute = false; // tat giao dien
            process.StartInfo.CreateNoWindow = true; // tat tao cua so moi
            process.StartInfo.RedirectStandardOutput = true; // xuat du lieu tieu chuan
            process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; // an cua so


            // chay tien trinh
            process.Start();

            // doc du lieu tra lai cua chuong trinh
            // Stream data = process.StandardOutput.BaseStream;
 
Top