I am getting \"The system cannot find the file specified Exception\" in Process.Start on tscon
Working:
Process.Start(new ProcessStartInfo(@\"c:\\Win
Oh well, this thing has really got my attention.
I have finally managed to start the tscon.exe from Process.Start.
You need to pass your "admin" account info, otherwise you get the 'File not found' error.
Do in this way
ProcessStartInfo pi = new ProcessStartInfo();
pi.WorkingDirectory = @"C:\windows\System32"; //Not really needed
pi.FileName = "tscon.exe";
pi.Arguments = "0 /dest:console";
pi.UserName = "steve";
System.Security.SecureString s = new System.Security.SecureString();
s.AppendChar('y');
s.AppendChar('o');
s.AppendChar('u');
s.AppendChar('r');
s.AppendChar('p');
s.AppendChar('a');
s.AppendChar('s');
s.AppendChar('s');
pi.Password = s;
pi.UseShellExecute = false;
Process.Start(pi);
also to see the result of the command change the following two lines
pi.FileName = "cmd.exe";
pi.Arguments = "/k \"tscon.exe 0 /dest:console\"";