Last active 1741880437

Revision 69cc9d18dfe0a03a2fea9f492e4909e2fea95118

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
12if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b)
13
14:: !!! These variables may need to be changed
15
16:: The directory where PlayGTAV.exe and GTAV.exe are located
17Set GTADir="S:\Grand Theft Auto V"
18:: Is the game STEAM or WAREHOUSE? TRUE for STEAM, blank for WAREHOUSE
19Set IsSteamVersion=TRUE
20:: How long until after process detected to inject? (in seconds)
21:: 1 second allows for patch to skip r* credits, > 2 will be too late.
22Set WaitToInject=1
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
29:: Executables
30Set Process=GTA5.exe
31Set RockstarLauncher=Launcher.exe
32Set Executable=Xenos64.exe
33
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 defined IsSteamVersion (
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
49If not errorlevel 1 (
50 :: If process is found, inject.
51 echo GTAV Found, Running %Executable% for Profile %ProfileName%
52 cd /D %ExecutableDir%
53 timeout /t %WaitToInject%
54 echo Running executable
55 start /WAIT %Executable% --run %ProfileName%
56 echo Executable ran, will automatically close when game exits.
57 goto waitForGameExit
58) else (
59 :: Process still not found, continue loop after 1s
60 timeout /t 1 /nobreak > nul
61 goto findGTA
62
63)
64
65:waitForGameExit
66tasklist /NH /FI "imagename eq %Process%" 2>nul |find /i "%Process%" >nul
67If errorlevel 1 (
68 echo Detected game has closed, exiting...
69 timeout /T 2 /nobreak > nul
70 echo Closing social club launcher
71 wmic process where name="%RockstarLauncher%" call terminate
72) else (
73 timeout /t 6 /nobreak > nul
74 goto waitForGameExit
75)