Close/start programs at game start/end

Forums Main Tutorials Close/start programs at game start/end

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by PeppaPig PeppaPig 6 months, 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #148
    n0xew
    n0xew
    Keymaster

    Hi !

    Here is a tutorial that will allow you to close/start programs when a game is launched, and same when it ends.

    A little disclaimer first : this tutorial uses command lines. Follow it only if you are sure of what you are doing. Using incorrect command lines can be dangerous for your computer. And the usual : I may not be held responsible for any harm that your manipulations on GameRoom could have produced.

    Fine, we can now proceed.

    Firs of all, make sure that you are in advanced mode :

    Now we have to options :

    1. You can set actions to execute before (after) any game is started (stopped)
    2. Or you can set it per game

    The process is quite the same, so let’s first show case 1.

    In the “Settings” screen, go to the “On Game Start” tab. You should see two new fields, “Before Starting” and “After stopping”. In both of them, you should input command lines to execute before/after a game’s execution.

    For our example, our commands will be to close a program before starting a game, and open a program after it. This could be useful when you need a given program to run usually but it can affect your ingame performances. In my case, I truly need Google Drive to run when I’m not playing but I don’t want it running in the background when I’m gaming as its indexing process can really hog the processor thus causing massive FPS drops…

    First, you need to get the application’s path and executable’s name. If you don’t know how to do it, you can follow this small tutorial.

    Now to close a program, you just its executable name. In the case of Google Drive, it’s  googledrivesync.exe. The command to use is then :

    taskkill /F /IM "googledrivesync.exe"

     

    where /F is an option to force kill the program. Beware, this will of course not save any changes done in your program!

    Now to open a program, we need the app path (in our example C:\Program Files (x86)\Google\Drive\googledrivesync.exe), and use the following command :

    start "" "C:\Program Files (x86)\Google\Drive\googledrivesync.exe"
    

    Do not forget the "" before the app’s path, those are important ! If you wish, you can also add options following the app path to start it minimized for example.

    So basically we have in GameRoom :

    And this is it! For every game started/closed,  GameRoom will execute these commands before/after the game’s execution, killing our software’s process and restarting it afterwards.

    To get it to work per game only, you only need to edit your game and set those commands into the “Before starting” and “After stopping” fields dedicated to this game.

    Thanks for reading, and have fun gaming !

    UPDATE 15.03.2018:

    With update 1.1.2.0 come new variables that can be used in your command lines and replaced at runtime by GameRoom. Here is the up-to-date list of variables GameRoom will replace:

    • %p: game’s path (usually last).
    • %a: game’s arguments (usually before path, allows you to set for each game a different config).
    • %n: game’s name
    • %l: platform the game is running on
    • %d: last play time, in seconds
    • %t: total playtime, in seconds
    • This topic was modified 1 year, 1 month ago by n0xew n0xew.
    • This topic was modified 5 months ago by n0xew n0xew.
    1
    #290
    PeppaPig
    PeppaPig
    Participant

    Hello,

    Thank you or this cool feature. Could you please add some variables we can add in these fields?

    %t : Game Title

    Optionnal :

    %f : Game Full path (typically exe path)

    %p : Game Platform (pc, etc.)

    %d : played time during this session (only for “after stopping”)

    %r : Total played time

     

    Thank you by advance. This software has a great potential, I just bought the key.

    0
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.