launch_gtao_patch.bat
· 2.8 KiB · Batchfile
Raw
:: 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
)
1 | :: Launch GTA Online Patch v1.2 |
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 | title Launch GTA Online Patch |
11 | |
12 | |
13 | :: If you want to auto launch as admin, uncomment this: (Relaunches batch as admin) |
14 | ::if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b) |
15 | |
16 | :: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
17 | :: !!! These variables may need to be changed !!! |
18 | :: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
19 | |
20 | :: The directory where PlayGTAV.exe and GTAV.exe are located |
21 | Set GTADir="S:\Grand Theft Auto V" |
22 | :: Is the game STEAM or WAREHOUSE? TRUE for STEAM, blank for WAREHOUSE |
23 | Set IsSteamVersion=true |
24 | :: How long until after process detected to inject? (in seconds) |
25 | :: 1 second allows for patch to skip r* credits, > 2 will be too late. |
26 | Set WaitToInject=1 |
27 | :: The name of the injector profile with the extension |
28 | Set ProfileName=OnlinePatch.xpr64 |
29 | :: The directory to find the executable, defaults to location of this .bat file. |
30 | set ExecutableDir="%cd%" |
31 | |
32 | :: Executables (You don't need to change these!) |
33 | Set Process=GTA5.exe |
34 | Set RockstarLauncher=Launcher.exe |
35 | Set ExecutableFileName=Xenos64.exe |
36 | |
37 | :: If GTA5.exe not running, starts via PlayGTAV.exe (May not work on Steam version) |
38 | cd /D %GTADir% |
39 | tasklist /NH /FI "imagename eq %Process%" 2>nul |find /i "%Process%" >nul |
40 | If errorlevel 1 ( |
41 | echo Game is not running, starting. STEAM: %IsSteamVersion% |
42 | If defined IsSteamVersion ( |
43 | start "" "steam://run/271590//-goStraightToMP -StraightIntoFreemode/" |
44 | ) else start PlayGTAV.exe -goStraightToMP -StraightIntoFreemode |
45 | ) |
46 | |
47 | :: Starts looking for the process |
48 | echo Looking for %Process%... |
49 | :findGTA |
50 | tasklist /NH /FI "imagename eq %Process%" 2>nul |find /i "%Process%" >nul |
51 | If not errorlevel 1 ( |
52 | :: If process is found, inject. |
53 | echo GTAV Found, Running %ExecutableFileName% for Profile %ProfileName% |
54 | cd /D %ExecutableDir% |
55 | timeout /t %WaitToInject% |
56 | echo Running executable |
57 | start /WAIT %ExecutableFileName% --run %ProfileName% |
58 | echo Executable ran, will automatically close when game exits. |
59 | goto waitForGameExit |
60 | ) else ( |
61 | :: Process still not found, continue loop after 1s |
62 | timeout /t 1 /nobreak > nul |
63 | goto findGTA |
64 | |
65 | ) |
66 | |
67 | :waitForGameExit |
68 | tasklist /NH /FI "imagename eq %Process%" 2>nul |find /i "%Process%" >nul |
69 | If errorlevel 1 ( |
70 | echo Detected game has closed, exiting... |
71 | timeout /T 2 /nobreak > nul |
72 | echo Closing social club launcher |
73 | wmic process where name="%RockstarLauncher%" call terminate |
74 | ) else ( |
75 | timeout /t 6 /nobreak > nul |
76 | goto waitForGameExit |
77 | ) |