I am trying to execute a command on "psexec" by passing some variable to it. Tried various ways to execute it but still not able to accomplish it.
I want to execute following with button event handler.
private void button3_Click(object sender, EventArgs e)
{
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents = false;
proc.StartInfo.FileName = "psexec.exe"; //currently its in debug folder
proc.StartInfo.Arguments = "/c \\10.10.1.10 -u domain\test1 -p testpass " + "C:\\windows\\system32\\cmd.exe";
proc.Start();
// proc.WaitForExit();
MessageBox.Show("Command Exected");
}