0
votes

I am adding security to one of my application. I would like that on Enable, C:\Windows\System32\mstsc.exe c:\thinclient\pekts00.rdp with .rdp (remote desktop) configured is launched. It will continue to run to check if mstsc.exe is running and will logoff windows or start it if it is not.

1

1 Answers

1
votes

Try like below... It will help you...

System.Diagnostics.Process[] pname = System.Diagnostics.Process.GetProcessesByName("mstsc");
if (pname.Length == 0)
 System.Diagnostics.Process.Start(Environment.GetEnvironmentVariable("windir") + @"\system32\mstsc.exe");