Last active 1741880437

Revision 8bc43a04f930b7c6dc146ca034321ea72e146d5a

launch_gtao_patch.bat Raw
1:: Launch GTA Online Patch
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
16Set GTADir="S:\Grand Theft Auto V"
17:: Is the game STEAM or WAREHOUSE? 1 for STEAM, 0 for WAREHOUSE
18Set IsSteamVersion=1
19:: How long until after process detected to inject? (in seconds)
20Set WaitToInject=10
21:: How long to wait to look for GTA5.exe? (in seconds)
22Set ProcessFindTimeout=20
23:: The name of the injector profile with the extension
24Set ProfileName=OnlinePatch.xpr64
25:: The directory to find the executable, defaults to location of this .bat file
26set ExecutableDir="%cd%"
27
28
29Set count=0
30:: Executables
31Set Process=GTA5.exe
32Set RockstarLauncher="Launcher.exe"
33Set Executable=Xenos64.exe
34
35:: If GTA5.exe not running, starts via PlayGTAV.exe (May not work on Steam version)
36cd /D %GTADir%
37tasklist /NH /FI "imagename eq %Process%" 2>nul |find /i "%Process%" >nul
38If errorlevel 1 (
39 echo Game is not running, starting. STEAM: %IsSteamVersion%
40 If IsSteamVersion equ 1 (
41 start "" "steam://run/271590//-goStraightToMP -StraightIntoFreemode/"
42 ) else start PlayGTAV.exe -goStraightToMP -StraightIntoFreemode
43)
44
45:: Starts looking for the process
46echo Looking for %Process%
47:findGTA
48tasklist /NH /FI "imagename eq %Process%" 2>nul |find /i "%Process%" >nul
49:: Checks if the timeout has been reached, if not continue down below
50If %Count% EQU %ProcessFindTimeout% (
51 echo Could not find GTAV before timeout
52 CHOICE /D N /T 20 /M "Do you want to try again?"
53 IF ERRORLEVEL 2 exit /b
54 IF ERRORLEVEL 1 (
55 echo Looking for %Process%
56 set /A Count=0
57 goto findGTA
58 )
59)
60set /A Count=Count+1
61If not errorlevel 1 (
62 :: If process is found, inject.
63 echo GTAV Found, Running %Executable% for Profile %ProfileName%
64 cd /D %ExecutableDir%
65 timeout /t %WaitToInject%
66 echo Running executable
67 start /WAIT %Executable% --run %ProfileName%
68 echo Executable ran, will automatically close when game exits.
69 goto waitForGame
70) else (
71 :: Process still not found, continue loop after 1s
72 timeout /t 1 /nobreak > nul
73 goto findGTA
74
75)
76
77:waitForGame
78tasklist /NH /FI "imagename eq %Process%" 2>nul |find /i "%Process%" >nul
79If errorlevel 1 (
80 echo Detected game has closed, exiting...
81 timeout /T 5 /nobreak > nul
82 echo Closing social club launcher
83 wmic process where name="%RockstarLauncher%" call terminate
84) else (
85 timeout /t 1 /nobreak > nul
86 goto waitForGame
87)