Close/start programs at game start/end
July 8, 2017 at 11:22 am #148
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.
Now we have to options :
- You can set actions to execute before (after) any game is started (stopped)
- 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"
/Fis 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.
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 !
With update 22.214.171.124 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:
February 6, 2018 at 4:19 pm #290
- %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
Thank you or this cool feature. Could you please add some variables we can add in these fields?
%t : Game Title
%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.
You must be logged in to reply to this topic.