Forum Discussion
Start OneDrive when using a RemoteApp in WVD
- Sep 26, 2019
We are in the process of documenting how to auto-start OneDrive in a Remote App scenario.
We will be documenting the following registry entry:
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\RailRunonce
I believe this works the same as the regular run keys, except that anything listed under this key will be launched when the remote session starts.
What happens is that in a remote session, Explorer.exe is not used as the Windows shell. rdpshell.exe is run instead. rdpshell.exe does not process Run entries. It does do the RailRunonce key though.
We have been experiencing the same issues. We've tried using the reg keys however it doesnt work on the first login, it does then work if a user logs out and back in again.
The solution we have found is to publish a bat script as the remote app that launches the target app and also restarts the OneDrive sync client. This works on the first login from a clean profile:
@echo off
cd "%ProgramFiles%\Windows NT\Accessories\"
start wordpad.exe
taskkill /F /FI "USERNAME eq %username%" /IM OneDrive.exe
cd "C:\Program Files (x86)\Microsoft OneDrive\"
start OneDrive.exe /background
exit
While this is quite dirty but it certainly does the job, better than making all users login once and then log out and back in again for KFM and FoD to work.
I tried that. It seems like OneDrive still opens and hangs once for every user at first login. Is this script all you had to change to make it work?