1

I have three accounts on Windows 2008: Admin, User1, User2, User3. I would like to run GUI program from Admin account using c# on these User1, User2, User3 accounts. The problem is that while using Process.Start with User1 or any other user credentials the GUI app starts on Admin user desktop. I would like to run program on User1 desktop. I would like to simulate behavior like manually we do: Switch User, Login with User1, Run GUI program. Is it possible to do that?

Tomas
  • 17,551
  • 43
  • 152
  • 257

1 Answers1

1

You should be able to run the program using different user credentials, if that's what you mean.

var processInfo = new ProcessStartInfo  
{  
    FileName = "app.exe",  
    UserName = "Username",  
    Domain = "yourdomain or leave blank",  
    Password = "password",  
    UseShellExecute = false, 
};  
Process.Start(processInfo); 
Bali C
  • 30,582
  • 35
  • 123
  • 152
  • This do not work because logged user use HOST USER DESKTOP. Let's say I run HOST app on Admin account. Host app run GUI app with User1 credentials. The launged app will run with User1 credentials but on Admin desktop. – Tomas Jun 25 '12 at 19:11
  • Did you ever get a solution to this, i.e. spawning the program on the user's desktop? Thanks! – joelc Mar 18 '15 at 02:24