Last active 1741880437

Revision fd9cb5b5228af91d31d4e06672894c14d7e21fee

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:: Links
7:: Xenos - https://github.com/DarthTon/Xenos
8:: Online Patch Booster - https://github.com/QuickNET-Tech/GTAO_Booster_PoC
9@echo off
10::If you want to auto launch as admin, uncomment this:
11::if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b)
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? TRUE for STEAM, blank for WAREHOUSE
18Set IsSteamVersion=true
19:: How long until after process detected to inject? (in seconds)
20:: 1 second allows for patch to skip r* credits, > 2 will be too late.
21Set WaitToInject=1
22:: The name of the injector profile with the extension
23Set ProfileName=OnlinePatch.xpr64
24:: The directory to find the executable, defaults to location of this .bat file
25set ExecutableDir="%cd%"
26
27
28:: Executables
29Set Process=GTA5.exe
30Set RockstarLauncher=Launcher.exe
31Set Executable=Xenos64.exe
32
33:: If GTA5.exe not running, starts via PlayGTAV.exe (May not work on Steam version)
34cd /D %GTADir%
35tasklist /NH /FI "imagename eq %Process%" 2>nul |find /i "%Process%" >nul
36If errorlevel 1 (
37 echo Game is not running, starting. STEAM: %IsSteamVersion%
38 If defined IsSteamVersion (
39 start "" "steam://run/271590//-goStraightToMP -StraightIntoFreemode/"
40 ) else start PlayGTAV.exe -goStraightToMP -StraightIntoFreemode
41)
42
43:: Starts looking for the process
44echo Looking for %Process%...
45:findGTA
46tasklist /NH /FI "imagename eq %Process%" 2>nul |find /i "%Process%" >nul
47If not errorlevel 1 (
48 :: If process is found, inject.
49 echo GTAV Found, Running %Executable% for Profile %ProfileName%
50 cd /D %ExecutableDir%
51 timeout /t %WaitToInject%
52 echo Running executable
53 start /WAIT %Executable% --run %ProfileName%
54 echo Executable ran, will automatically close when game exits.
55 goto waitForGameExit
56) else (
57 :: Process still not found, continue loop after 1s
58 timeout /t 1 /nobreak > nul
59 goto findGTA
60
61)
62
63:waitForGameExit
64tasklist /NH /FI "imagename eq %Process%" 2>nul |find /i "%Process%" >nul
65If errorlevel 1 (
66 echo Detected game has closed, exiting...
67 timeout /T 2 /nobreak > nul
68 echo Closing social club launcher
69 wmic process where name="%RockstarLauncher%" call terminate
70) else (
71 timeout /t 6 /nobreak > nul
72 goto waitForGameExit
73)