Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

If I'm the administrator and a user logs in through RDP, let's say I decide that there's a certain .exe that I want to run in the user's session. If I double-click the .exe, it will just run in my session. How can I make it run in the user's session?

share|improve this question
    
Do you want it to run as soon as they log into the RDP session, or do you want to start up the executable in an already existing session? –  Agent_9191 Aug 16 '10 at 10:18
    
I want to start it at any arbitrary time, not just when they log in. –  tony_sid Aug 16 '10 at 18:21
    
If the program and it's parameter doesn't differ you could create a scheduled task in the task scheduler which you would then only run manually... If not, you will either have to use PsExec, RunAs or something in the Telnet or SSH manner... Or write a command handling client which you start at start-up and runs the commands you send to it. –  Tom Wijsman Aug 16 '10 at 19:47

2 Answers 2

You can do this with PsExec, be sure to have the right permissions to run applications for him.

psexec \\computer -u user -i -d command

-u means user, -i makes it interactive so the user sees it, -d makes sure the command doesn't wait

Or maybe you are looking for the RemoteApp behavior?

share|improve this answer
    
I tried to use psexec and it just ran the program in my own session not the other user's. Does it work in Windows XP? –  tony_sid Aug 16 '10 at 18:36
    
It does work in Windows XP, seems my example fails then... It's sad that his article is premium. Did you use the command line as I gave it to you? Not removing any of the parameters? –  Tom Wijsman Aug 16 '10 at 19:24
    
Yeah, that's what I did. –  tony_sid Aug 16 '10 at 21:41

This really depends on what your exe is going to do. There are a number of ways to launch an app, but it can be tough to force an app launch when a user is logged in. Here are my suggestions for different types of apps.

Interactive app - An tool or utility that requires end user input.

  • Create a link and drop it in the user profile's desktop folder. (C:\users\"username"\Desktop)

Background App - Something that needs to be run every time the user logs on.

  • Add to the start-up list of shortcuts. You can do this by dropping a link in the "start up" folder in the start menu or by modifying the appropriate registry setting.
  • Create a scheduled task for this to run.

When it comes to software control, it can be tricky to get things to work correctly. The main problem with running software as another user is the windows security model. It tries to separate users in their own run space so a malicious user can't force another user to run arbitrary code.

Hope this helps

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.