title: C# - PsExec.exe - Running in the users context
body: <p>I have built an application called agent.exe.  I want to run it remotely after copying it to the users windows directory on their computer.  I however, am unable to launch it in the users context.</p>
  
  <p>(see this for my research: <a href="https://social.msdn.microsoft.com/Forums/en-US/f0851dcf-af49-4ba3-ba5f-bbfc79ef9076/how-do-i-start-any-application-sayskype-from-remote-machine-using-csharp?forum=csharplanguage" rel="nofollow">https://social.msdn.microsoft.com/Forums/en-US/f0851dcf-af49-4ba3-ba5f-bbfc79ef9076/how-do-i-start-any-application-sayskype-from-remote-machine-using-csharp?forum=csharplanguage</a>)</p>
  
  <p>I can run the following command in the command prompt, and it will show up on the users screen:
  PsExec.exe -s -d -i 2 \TargetComputer calc.exe</p>
  
  <p>I run the following command in the command prompt, but it will not show up in the users screen, instead it will show up in the SYSTEM's user context, so its not visible to the users.
  PsExec.exe -s -d -i 2 \TargetComputer mycustomapp.exe</p>
  
  <p>Nothing is different, except for the application is my custom C# application.</p>
  
  <p>What am I doing wrong, and is it in my custom application?</p>