launch_gtao_patch.bat
· 2.5 KiB · Batchfile
Raw
:: Launch GTA Online Patch (v1.1)
:: This batch file will automatically launch GTAV if not started, look for the process and inject using Xenos
:: You should probably at minimum change the GTADIR parameter below to where your GTA5.exe is
:: It will run Xenos64 in the folder the bat file is ran from, for the profile "OnlinePatch.xpr64"
:: May not work on steam due to different launch system, but will automatically launch gtav (and the rockstar launcher!)
:: Links
:: Xenos - https://github.com/DarthTon/Xenos
:: Online Patch Booster - https://github.com/QuickNET-Tech/GTAO_Booster_PoC
@echo off
:: !!! These variables may need to be changed
:: The directory where PlayGTAV.exe and GTAV.exe are located
Set GTADir="S:\Grand Theft Auto V"
:: Is the game STEAM or WAREHOUSE? 1 for STEAM, 0 for WAREHOUSE
Set IsSteamVersion=1
:: How long until after process detected to inject? (in seconds)
Set WaitToInject=1
:: The name of the injector profile with the extension
Set ProfileName=OnlinePatch.xpr64
:: The directory to find the executable, defaults to location of this .bat file
set ExecutableDir="%cd%"
:: Executables
Set Process=GTA5.exe
Set RockstarLauncher=Launcher.exe
Set Executable=Xenos64.exe
:: If GTA5.exe not running, starts via PlayGTAV.exe (May not work on Steam version)
cd /D %GTADir%
tasklist /NH /FI "imagename eq %Process%" 2>nul |find /i "%Process%" >nul
If errorlevel 1 (
echo Game is not running, starting. STEAM: %IsSteamVersion%
If IsSteamVersion equ 1 (
start "" "steam://run/271590//-goStraightToMP -StraightIntoFreemode/"
) else start PlayGTAV.exe -goStraightToMP -StraightIntoFreemode
)
:: Starts looking for the process
echo Looking for %Process%...
:findGTA
tasklist /NH /FI "imagename eq %Process%" 2>nul |find /i "%Process%" >nul
If not errorlevel 1 (
:: If process is found, inject.
echo GTAV Found, Running %Executable% for Profile %ProfileName%
cd /D %ExecutableDir%
timeout /t %WaitToInject%
echo Running executable
start /WAIT %Executable% --run %ProfileName%
echo Executable ran, will automatically close when game exits.
goto waitForGameExit
) else (
:: Process still not found, continue loop after 1s
timeout /t 1 /nobreak > nul
goto findGTA
)
:waitForGameExit
tasklist /NH /FI "imagename eq %Process%" 2>nul |find /i "%Process%" >nul
If errorlevel 1 (
echo Detected game has closed, exiting...
timeout /T 5 /nobreak > nul
echo Closing social club launcher
wmic process where name="%RockstarLauncher%" call terminate
) else (
timeout /t 6 /nobreak > nul
goto waitForGameExit
)
| 1 | :: Launch GTA Online Patch (v1.1) |
| 2 | :: This batch file will automatically launch GTAV if not started, look for the process and inject using Xenos |
| 3 | :: You should probably at minimum change the GTADIR parameter below to where your GTA5.exe is |
| 4 | :: It will run Xenos64 in the folder the bat file is ran from, for the profile "OnlinePatch.xpr64" |
| 5 | |
| 6 | :: May not work on steam due to different launch system, but will automatically launch gtav (and the rockstar launcher!) |
| 7 | |
| 8 | :: Links |
| 9 | :: Xenos - https://github.com/DarthTon/Xenos |
| 10 | :: Online Patch Booster - https://github.com/QuickNET-Tech/GTAO_Booster_PoC |
| 11 | @echo off |
| 12 | |
| 13 | :: !!! These variables may need to be changed |
| 14 | |
| 15 | :: The directory where PlayGTAV.exe and GTAV.exe are located |
| 16 | Set GTADir="S:\Grand Theft Auto V" |
| 17 | :: Is the game STEAM or WAREHOUSE? 1 for STEAM, 0 for WAREHOUSE |
| 18 | Set IsSteamVersion=1 |
| 19 | :: How long until after process detected to inject? (in seconds) |
| 20 | Set WaitToInject=1 |
| 21 | :: The name of the injector profile with the extension |
| 22 | Set ProfileName=OnlinePatch.xpr64 |
| 23 | :: The directory to find the executable, defaults to location of this .bat file |
| 24 | set ExecutableDir="%cd%" |
| 25 | |
| 26 | |
| 27 | :: Executables |
| 28 | Set Process=GTA5.exe |
| 29 | Set RockstarLauncher=Launcher.exe |
| 30 | Set Executable=Xenos64.exe |
| 31 | |
| 32 | :: If GTA5.exe not running, starts via PlayGTAV.exe (May not work on Steam version) |
| 33 | cd /D %GTADir% |
| 34 | tasklist /NH /FI "imagename eq %Process%" 2>nul |find /i "%Process%" >nul |
| 35 | If errorlevel 1 ( |
| 36 | echo Game is not running, starting. STEAM: %IsSteamVersion% |
| 37 | If IsSteamVersion equ 1 ( |
| 38 | start "" "steam://run/271590//-goStraightToMP -StraightIntoFreemode/" |
| 39 | ) else start PlayGTAV.exe -goStraightToMP -StraightIntoFreemode |
| 40 | ) |
| 41 | |
| 42 | :: Starts looking for the process |
| 43 | echo Looking for %Process%... |
| 44 | :findGTA |
| 45 | tasklist /NH /FI "imagename eq %Process%" 2>nul |find /i "%Process%" >nul |
| 46 | If not errorlevel 1 ( |
| 47 | :: If process is found, inject. |
| 48 | echo GTAV Found, Running %Executable% for Profile %ProfileName% |
| 49 | cd /D %ExecutableDir% |
| 50 | timeout /t %WaitToInject% |
| 51 | echo Running executable |
| 52 | start /WAIT %Executable% --run %ProfileName% |
| 53 | echo Executable ran, will automatically close when game exits. |
| 54 | goto waitForGameExit |
| 55 | ) else ( |
| 56 | :: Process still not found, continue loop after 1s |
| 57 | timeout /t 1 /nobreak > nul |
| 58 | goto findGTA |
| 59 | |
| 60 | ) |
| 61 | |
| 62 | :waitForGameExit |
| 63 | tasklist /NH /FI "imagename eq %Process%" 2>nul |find /i "%Process%" >nul |
| 64 | If errorlevel 1 ( |
| 65 | echo Detected game has closed, exiting... |
| 66 | timeout /T 5 /nobreak > nul |
| 67 | echo Closing social club launcher |
| 68 | wmic process where name="%RockstarLauncher%" call terminate |
| 69 | ) else ( |
| 70 | timeout /t 6 /nobreak > nul |
| 71 | goto waitForGameExit |
| 72 | ) |