Last active
February 16, 2023 20:38
-
-
Save Jackzmc/8cd179cdf529d85e91257f50b9885534 to your computer and use it in GitHub Desktop.
A batch file to launch the game or auto inject using xenos (https://github.com/DarthTon/Xenos) injector the GTA online patch: https://github.com/QuickNET-Tech/GTAO_Booster_PoC.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: Launch GTA Online Patch v1.2 | |
:: 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" | |
:: Links | |
:: Xenos - https://github.com/DarthTon/Xenos | |
:: Online Patch Booster - https://github.com/QuickNET-Tech/GTAO_Booster_PoC | |
@echo off | |
title Launch GTA Online Patch | |
:: If you want to auto launch as admin, uncomment this: (Relaunches batch as admin) | |
::if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b) | |
:: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
:: !!! 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? TRUE for STEAM, blank for WAREHOUSE | |
Set IsSteamVersion=true | |
:: How long until after process detected to inject? (in seconds) | |
:: 1 second allows for patch to skip r* credits, > 2 will be too late. | |
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 (You don't need to change these!) | |
Set Process=GTA5.exe | |
Set RockstarLauncher=Launcher.exe | |
Set ExecutableFileName=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 defined IsSteamVersion ( | |
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 %ExecutableFileName% for Profile %ProfileName% | |
cd /D %ExecutableDir% | |
timeout /t %WaitToInject% | |
echo Running executable | |
start /WAIT %ExecutableFileName% --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 2 /nobreak > nul | |
echo Closing social club launcher | |
wmic process where name="%RockstarLauncher%" call terminate | |
) else ( | |
timeout /t 6 /nobreak > nul | |
goto waitForGameExit | |
) |
v1.2 actually fixes steam support (Put a value for IsSteamVersion, leave blank if not)
In addition, there is a line that can automatically relaunch script with admin permissions, uncomment it if you need it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
General flow of script since v1.1:
You will need:
Xenos Injector (Xenos64.exe is used, edit file to non-64 if you are somehow using 32bit windows)
GTA Online Booster Patch
By default, you WILL need to change the variable "GTADIR", the directory for xenos should be where the bat file was executed from, but can be hardcoded as that is more reliable. You will need to store a xenos profile named whatever ProfileName is (default is "OnlinePatch").
You can (as I have warehouse, but want to show on steam) create a shortcut to steam, which will show you playing the game if you name it Grand Theft Auto V, and the script will stay open until game closes. You should create a shortcut of the bat, and open it's properties, advanced -> run as admin so you will not have to run xenos later. You can then link steam to that shortcut, so all you have to do is launch the game and enjoy!
IF you are using warehouse, change IsSteamVersion to 0, or it will try to launch the steam version instead!