Link to home
Start Free TrialLog in
Avatar of z969307
z969307Flag for United States of America

asked on

Launch Program in background When User Initiates a Remote APP Session

I have a small in-house developed utility that I need to run when a user launches their Remote APP from a Windows 2008 R2 Terminal Server. The utility needs to run in the background and no console/user interaction is required. I threw the shortcut in C:\Users\username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup on the server, but when the user launches their Remote APP, nothing happens.

I need to avoid using launch up parameters/script based on the user account properties in AD as the utility just needs to run on the server with the remote app. The user logs into their local computer and other resources so if i do a global script etc this would cause issues when user logs on other systems.

Any thoughts , ideas, suggestion on how I can accomplish this.
I created a service out of this, but this was not successful due to permissions issue.

Thank you.
Avatar of Jaroslav Mraz
Jaroslav Mraz
Flag of Slovakia image

Hi,

yes because user is not starting full desktop mode the startup folder is ignored.

You can do a simple thing make BAT file and point it as RemoteApp so when user start up it will start BAT file that run your app and then it will run normal requested APP. Or change your utility to do this and point remote app on your utility. You can rename it in properties and change ICON like your original app so user will have no idea.
Avatar of z969307

ASKER

just so i understand correctly...
you are saying just publish it out as remote app and have the user start it, right?

It did occur to me, I'll reserve this as a last option. I have to push this out to almost 2 dozen users and servers, it would be great if i can have an option where this runs when the user logs in and stops when the user logs out.

Thanks you
I sugest to run it wit RemoteApp by script so when you click on APP you want it first run your app to background and then your APP run REQUESTED APP.

IN BAT SCRIPT LIKE

RUN YOUR SCRIPT
RUN REQUESTEDAPP.EXE

for automatic stop you can setup RDS server to END DISCONECTED session after 1min. So if user exit app server will automatically logout him after one minute after
ASKER CERTIFIED SOLUTION
Avatar of z969307
z969307
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of z969307

ASKER

I was able to figure out the solution.
If anyone is still interested:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\ ->Registry entry StartupPrograms
holds the startup entries for remoteapp sessions. Please use "," to separate the entries, Example:
rdpclip,your.exe,%userprofile%\desktop\your.bat

Open in new window

McKnife,

Can you put the /background switch in that key location too?    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd

Something like:  "rdpclip,your.exe,%userprofile%\desktop\your.bat,%Program Files%\Microsoft OneDrive\OneDrive.exe /background"

Hi Baba. I guess so. Please just try it out. As admin, you may launch task manager to verify if one drive runs for other users.