Borderless Gaming

Borderless Gaming

Not enough ratings
How to automatically open/close the app along with the game
By HSete
   
Award
Favorite
Favorited
Unfavorite
Introduction
It is extremely annoying having to open this app before playing and having to close it after playing. To resolve this, I created the batch script below. I hope the developer adds this function natively someday.
Requirements
  1. Add game to app before automating.
  2. Disable Check For Updates* and enable Start Minimized To Tray in the app Options.

* Keeping Check For Updates active will cause an error if you try to play offline.
Tutorial
  1. Copy and paste the code below into Notepad:
    @Echo Off & CHCP.com 65001>Nul Title BLG Set "BLG=" Set "Exe=" Set "Min=1" CD /D "%~dp0" For %%H In ("%BLG%\BorderlessGaming.exe" "%Exe%.exe") Do (If Not Exist "%%H" (Start Notepad.exe "%~f0" & Exit)) Set __COMPAT_LAYER=RunAsInvoker Call :Min0%Min% Start "" "%BLG%\BorderlessGaming.exe" --silent --minimize Start "" "%Exe%.exe" (PowerShell.exe -NoProfile -Command "While ($True) {If (Get-Process -Name $Env:Exe) {Break} Else {Start-Sleep -Seconds 3}}; Wait-Process -Name $Env:Exe")>Nul 2>&1 Taskkill.exe /IM BorderlessGaming.exe /F Exit :Min01 If "%HF%"=="?" (Goto :EOF) Set "HF=?" Start /Min Cmd.exe /C Call "%~f0" Exit :Min02 Timeout.exe /T 2 /NoBreak>Nul Start /B "" PowerShell.exe -NoProfile -WindowStyle Minimized -Command "Exit" Goto :EOF

  2. Define the variables below:
    Set "BLG=" Set "Exe=" Set "Min=1"


    BLG=
    Full path of the folder containing the Borderless Gaming executable.
    Exe=
    Executable file name of the game, without the .exe extension.
    Min=
    Choose between methods 1 and 2 to minimize the CMD window. In some games, using method 1 may lead to the game not being recognized as running.


    Example:
    Set "BLG=E:\Steam\steamapps\common\Borderless Gaming" Set "Exe=PES2021" Set "Min=1"

  3. Save the file as "BLG.cmd" in the folder where the game's executable is located*.



    * To find the location of the game or Borderless Gaming, go to the Library, right-click on the item, go to Manage and then select the Browse local files option.



  4. Right-click on the game in the Library and select Properties.



  5. In the screen that opens, enter the path of the BLG.cmd file that you saved and the variable "%command%" in Launch Options.

    Example:
    "E:\Steam\steamapps\common\eFootball PES 2021\BLG.cmd" %command%



  6. Open the game and have fun.
3 Comments
Tarsus 25 Jan, 2024 @ 11:41pm 
I just like to see how high I can get the playtime so I can edit screenshots of my playtime in other games so they look as if I have an obscene playtime.
HSete  [author] 22 Jan, 2024 @ 3:03am 
Because I don't see the point in leaving this application running while I'm not playing.
[078930]T[FCDD09]M[DA121A]k 22 Jan, 2024 @ 2:57am 
why do you open and close the app instead of setting it to autorun at system startup and leaving it turned on? just curious