0

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.

Drew Salesse
  • 127
  • 1
  • 3
  • 18

1 Answers1

1

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");
Pandian
  • 8,848
  • 2
  • 23
  • 33