Run Plex app (Windows 10) from Steam – or how to run a Win 10 app from a shortcut

Update 2: 18 June 2017. Added quotation marks around the command in the batch file to allow for any spaces.

Update 1: 20 NOV 2016: Added a tweak to the batch file before you make it an executable to add some compatibility with Steam and nVidia streaming.

Background: I use the Steam Link to remotely play games on my family room TV. It’s basically a glorified remote desktop/streaming device.

Wouldn’t it be great if it could play Plex remotely so I could watch movies, TV, etc? In order to do this, you have to launch the application you want to view from within Steam. Easy enough for a “traditional” x86 app (i.e. one that is the type “something.exe”) but more difficult to launch a Windows Store application. As anyone who has tried knows, they are not only hidden, but don’t launch with an executable file.

Attempt 1: I tried launching using the shortcut to the Plex app – which sort of worked.

If you want to get a shortcut to any application, Windows Store or traditional, the best way I’ve found is to open the hidden “Applications” folder and create/drag a shortcut. You can open this hidden folder by going to “Run” (shortcut: Windows key + R) and type shell:AppsFolder then hit OK (or press enter.)

I created a shortcut to the Plex app, moved it to my D: drive, and used that shortcut in Steam as a non-Steam app to launch the Plex App. Problem was, although it would launch, it would always have an error box behind it.

Attempt 2 – Et voila!: A bit more complicated, but works very well. Basically you create a batch file that runs the shortcut, and turn the batch file into an executable file.

Steps:

  1. Open Notepad and type the following, saving it as “Bat2Exe.bat”: (Or download it from me here.)
;@echo off

; rem https://github.com/npocmaka/batch.scripts/edit/master/hybrids/iexpress/bat2exeIEXP.bat
 ;if "%~2" equ "" (
 ; echo usage: %~nx0 batFile.bat target.Exe
 ;)
 ;set "target.exe=%__cd__%%~2"
 ;set "batch_file=%~f1"
 ;set "bat_name=%~nx1"
 ;set "bat_dir=%~dp1"

;copy /y "%~f0" "%temp%\2exe.sed" >nul

;(echo()>>"%temp%\2exe.sed"
 ;(echo(AppLaunched=cmd.exe /c "%bat_name%")>>"%temp%\2exe.sed"
 ;(echo(TargetName=%target.exe%)>>"%temp%\2exe.sed"
 ;(echo(FILE0="%bat_name%")>>"%temp%\2exe.sed"
 ;(echo([SourceFiles])>>"%temp%\2exe.sed"
 ;(echo(SourceFiles0=%bat_dir%)>>"%temp%\2exe.sed"
 ;(echo([SourceFiles0])>>"%temp%\2exe.sed"
 ;(echo(%%FILE0%%=)>>"%temp%\2exe.sed"
 ;iexpress /n /q /m %temp%\2exe.sed

;del /q /f "%temp%\2exe.sed"
 ;exit /b 0

[Version]
 Class=IEXPRESS
 SEDVersion=3
 [Options]
 PackagePurpose=InstallApp
 ShowInstallProgramWindow=0
 HideExtractAnimation=1
 UseLongFileName=1
 InsideCompressed=0
 CAB_FixedSize=0
 CAB_ResvCodeSigning=0
 RebootMode=N
 InstallPrompt=%InstallPrompt%
 DisplayLicense=%DisplayLicense%
 FinishMessage=%FinishMessage%
 TargetName=%TargetName%
 FriendlyName=%FriendlyName%
 AppLaunched=%AppLaunched%
 PostInstallCmd=%PostInstallCmd%
 AdminQuietInstCmd=%AdminQuietInstCmd%
 UserQuietInstCmd=%UserQuietInstCmd%
 SourceFiles=SourceFiles

[Strings]
 InstallPrompt=
 DisplayLicense=
 FinishMessage=
 FriendlyName=-
 PostInstallCmd=<None>
 AdminQuietInstCmd=
 UserQuietInstCmd=

2. Open Notepad again, and enter the location for your shortcut. In my case it was "D:\Plex - Shortcut.lnk" Also add the text pause as the next line to enable some better compatibility with Steam and/or Nvidia streaming. Save that file as “WhateverYouWant.bat”. I called mine PlexApp.bat; the file looked like this:

"D:\Plex - Shortcut.lnk"
pause

3. Ensure both batch files are in the same location (I saved both of mine to the D: drive to make the next step easier.)

4. Open a command prompt and go the location of the two batch files.

5. Run the command Bat2Exe.bat WhateverYouWant.bat WhateverYouWant.exe and it will create an executable file that does the same thing as the batch file.

6. You can delete both batch files now if you want, but DO NOT DELETE the shortcut. The executable file you just created still runs the shortcut!

7. In Steam, when you add a non-Steam game, select the new executable file you created.

8. Success!

 

P.S. The Plex App runs windowed by default. Actually, it will open in whatever state it was last closed in – so if you want it to open full screen you have to run it, make it full screen, and exit the app while in full screen mode.

Bookmark the permalink.

One Response to Run Plex app (Windows 10) from Steam – or how to run a Win 10 app from a shortcut

  1. cbtlr says:

    Plex Media Player launches helper services when exiting Plex – even under this method, Steam believes the app to still be running and then will not let you exit the application.