The other day I wanted to make Mediaportal boot directly on my HTPC, but still use some desktop functionality on occasions.
The easiest way to do this is to change the Windows shell from explorer.exe to the executable of your choice. This can be done for all users by changing this registry key:
In Windows 8.1 (and probably earlier versions) you can’t simply use Ctrl+Alt+Delete > Task Manager > File > Run New Task > explorer.exe – as explorer is no longer set as the shell so it will simply open an explorer file window rather than restore the desktop environment.
You will need to set the registry key back to explorer.exe and run userinit.exe to get the desktop back.
I will write a longer post about the whole experience at some point, but in the meantime here’s a batch file I wrote to achieve what I needed for MediaPortal saved as C:\Utils\startmp.bat:
C:\Program Files\Team MediaPortal\MediaPortal\MediaPortal.exe reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v Shell /t REG_SZ /d explorer.exe /f C:\Windows\System32\userinit.exe reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v Shell /t REG_SZ /d C:\Utils\startmp.bat /f
Basically starts the program we want, when that program is quit, it sets the Windows shell as explorer, runs userinit and then resets the Windows shell to the batch file ready for next reboot.