Starting a game auto-starts Xpadder and auto-closes it when you exit the game
- Create a new .txt document (preferably in the base folder of the game you want to use Xpadder with), name it whatever you want. Let's call it template.txt for this tutorial.
- Open the document, copy & paste the following code:
Code: Select all
start "" "X:\Programmpath1\Programm1.exe" wait call "X:\Programmpath2\Programm2.exe" wait taskkill /im "Programm1.exe" /F wait exit
- Now edit the code to fit your own programm paths. The first program should always be the tool / program (in this case Xpadder), the second the game executable. Let's asume you use the following path for Xpadder and for the game Freespace 2 Open. For me it looks like this:
Make sure to alter the paths to fit YOUR folders and filenames!
Code: Select all
start "" "C:\Program Files (x86)\Xpadder\Xpadder.exe" wait call "E:\Freespace 2\Launcher.exe" wait taskkill /im "Xpadder.exe" /F wait exit
- Save and close the .txt. If not already done, set Windows to show file extensions in the folder properties (control panel). Now change the extension from .txt to .bat (template.txt --> template.bat)
- Test it by double-clicking in the .bat. Start the game, see if Xpadder is loaded. Exit the game, see if Xpadder is terminated. NOTE: You have to move your mouse cursor over the tray icon of Xpadder manually in order to update the tray list.
- You can always send a shortcut of this .bat to the desktop and assign an icon. Since absolute paths are used you can also place the .bat file anywhere you want, it will still work.
PS: I got this "piece of code" from someone else a long time ago. Back then I was specifically asking for the right parameters to set it up like this and someone helped me. Or maybe I googled it. Bottom line: I forgot where and I forgot who, but it's not originally created by my own mind ^^. So my thanks goes to this person and yours should, too.