Title basically explains it all, but here's why:
I like and use the program autohotkey for keyboard shortcuts to programs I use regularly. However, in the past couple of months PunkBuster has started kicking me for it when I play BF3 so I decided to stop using it, but I really do miss it.
I know I can make a .bat file to kill autohotkey and then launch BF3, but I would like autohotkey to launch automatically once I quit BF3 (when the bf3.exe process dissapears)
Any suggestions? I'm sure once I do find a program to do this, I can find other uses for it as well.
EDIT: Finally came up with a solution. Thanks guys.
Edited by Evermind - 7/19/12 at 6:52pm
I like and use the program autohotkey for keyboard shortcuts to programs I use regularly. However, in the past couple of months PunkBuster has started kicking me for it when I play BF3 so I decided to stop using it, but I really do miss it.
I know I can make a .bat file to kill autohotkey and then launch BF3, but I would like autohotkey to launch automatically once I quit BF3 (when the bf3.exe process dissapears)
Any suggestions? I'm sure once I do find a program to do this, I can find other uses for it as well.
EDIT: Finally came up with a solution. Thanks guys.
Code:
@echo off
TASKKILL /im Autohotkey*
START "BF3" "G:\Program Files (x86)\Electronic Arts\Battlefield 3\bf3.exe"
echo Give BF3.exe time to start Origin and Browser and then quit itself.
timeout 15
:isOriginRunning
tasklist /nh /FI "Imagename eq Origin.exe" 2>NUL | find /I /N "Origin.exe">NUL
if "%ERRORLEVEL%"=="1" goto OriginHasStopped
echo Origin is running. You are probably just taking a break or choosing a server.
goto :WaitForBF3toStart
:WaitForBF3toStart
timeout 3
tasklist /nh /FI "Imagename eq bf3.exe" 2>NUL | find /I /N "bf3.exe">NUL
if "%ERRORLEVEL%"=="1" goto isOriginRunning
:BF3HasStarted
timeout 3
tasklist /nh /FI "Imagename eq bf3.exe" 2>NUL | find /I /N "bf3.exe">NUL
if "%ERRORLEVEL%"=="1" goto BF3HasStopped
echo BF3 is running.
goto BF3HasStarted
:BF3HasStopped
echo BF3 is not running anymore. Checking if Origin is still running...
goto isOriginRunning
:OriginHasStopped
echo You are probably done playing BF3 for now. Launching AutoHotkey now.
START "AHK" "C:\Program Files (x86)\AutoHotkey\AutoHotkey.exe"
TASKKILL /f /im iexplore.exe
goto END
:END
Edited by Evermind - 7/19/12 at 6:52pm







