0

I have used this code to implement RDP.

This works fine but now I want to implement a system , that will call a particular EXE file from the server. Not the whole desktop.

Any idea how can I implement this?

Process rdcProcess = new Process();

rdcProcess.StartInfo.FileName = Environment.ExpandEnvironmentVariables(@"%SystemRoot%\system32\cmdkey.exe");
rdcProcess.StartInfo.Arguments = "/generic:TERMSRV/192.168.0.16 /user:" +Saltlake1" + " /pass:" + "saltlake@1234";
rdcProcess.Start();

rdcProcess.StartInfo.FileName = Environment.ExpandEnvironmentVariables(@"%SystemRoot%\system32\mstsc.exe");
rdcProcess.StartInfo.Arguments = "/v " + "192.168.0.16"; 
rdcProcess.Start();
Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Paul S
  • 81
  • 2
  • 13
  • It may "work fine" at the moment but that's more by luck than anything else. You don't wait for the first command to complete, so it's possible that the second command will be executed and not locate any credentials. – Damien_The_Unbeliever Jun 23 '14 at 06:13
  • ok thank you , but i am now trying to make a programe that will call a particular EXE file fro remote server – Paul S Jun 23 '14 at 07:04

0 Answers0