Heres how to execute a command... but I need to know what language your using. your suppose to put a [C#] [VB.net] ect...
This is the kind of thing you can just google for... usually. Heres how to execute the command... but I'm sure there is a simple wrapper for the cmd if you just search for it.
public static int ExecuteCommand(string Command, int Timeout)
ProcessInfo = new ProcessStartInfo("cmd.exe", "/C " + Command);
ProcessInfo.CreateNoWindow = true;
ProcessInfo.UseShellExecute = false;
Process = Process.Start(ProcessInfo);
ExitCode = Process.ExitCode;