Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ::Request admin access for Win10 support
- :-------------------------------------
- >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
- if '%errorlevel%' NEQ '0' (
- goto UACPrompt
- ) else ( goto gotAdmin )
- :UACPrompt
- echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
- set params = %*:"=""
- echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
- "%temp%\getadmin.vbs"
- del "%temp%\getadmin.vbs"
- exit /B
- :gotAdmin
- pushd "%CD%"
- CD /D "%~dp0"
- :--------------------------------------
- ::Set the basic shit. I know delayed expansion isn't needed, but I include it anyways.
- Title GTA5 Mode Selector
- SETLOCAL EnableDelayedExpansion EnableExtensions
- @echo off
- cls
- ::Basic prompt.
- :Start
- @echo Which mode do you want to run?
- @echo (1) Vanilla
- @echo (2) Modded
- SET /p GTA5Switch=
- IF "%GTA5Switch%"=="1" goto Vanilla
- IF "%GTA5Switch%"=="2" goto Modded
- @echo I didn't get that. Type only 1 or 2.
- goto Start
- ::If the 2 files are found in the main directory then inform the user.
- :Vanilla
- cls
- @echo Checking if mods are present.
- IF EXIST "D:\Games\Grand Theft Auto V\dinput8.dll" SET dinputfound=1
- IF EXIST "D:\Games\Grand Theft Auto V\ScriptHookV.dll" SET ScriptHookVFound=1
- timeout 3 /nobreak >nul
- IF DEFINED dinputfound @echo Found dinput
- IF DEFINED ScriptHookVFound @echo Found ScriptHookV
- timeout 3 /nobreak >nul
- IF DEFINED dinputfound goto dinput
- IF DEFINED ScriptHookVFound goto ScriptHookVFound
- ::Check specifically for dinput8.dll. If it's present, move it to the ../mods folder. Also creates a mods folder if it is not present, then skips attempting to make the folder for the next time the program is ran.
- :dinput
- IF EXIST "D:\Games\Grand Theft Auto V\Mods" GOTO SkipMkDirDinput
- MKDIR "D:\Games\Grand Theft Auto V\Mods\"
- :SkipMkdirDinput
- MOVE /Y "D:\Games\Grand Theft Auto V\dinput8.dll" "D:\Games\Grand Theft Auto V\Mods\" >nul
- ::Check specifically for ScriptHookV.dll. If it's present, move it to the ../mods folder. Also creates a mods folder if it is not present, then skips attempting to make the folder for the next time the program is ran.
- :ScriptHookVFound
- IF EXIST "D:\Games\Grand Theft Auto V\Mods" GOTO SkipMkDirScriptHook
- MKDIR "D:\Games\Grand Theft Auto V\Mods\"
- :SkipMkdirScriptHook
- MOVE /Y "D:\Games\Grand Theft Auto V\ScriptHookV.dll" "D:\Games\Grand Theft Auto V\Mods\" >nul
- ::Start the game, wait, then close the window.
- :StartGTAV
- cls
- @echo Launching vanilla GTA5.
- START "" "D:\Games\Grand Theft Auto V\GTAVLauncher.exe"
- timeout 10 /nobreak >nul
- exit
- ::All of the documentation for this section is the same as vanilla, other than the MOVE command being reversed.
- ::Only difference is multiple checks to ensure both files are present and ready.
- :Modded
- cls
- @echo Checking if mods are present.
- IF EXIST "D:\Games\Grand Theft Auto V\dinput8.dll" SET dinputfound=1
- IF EXIST "D:\Games\Grand Theft Auto V\ScriptHookV.dll" SET ScriptHookVFound=1
- timeout 3 /nobreak >nul
- IF DEFINED dinputfound @echo Found dinput
- IF DEFINED ScriptHookVFound @echo Found ScriptHookV
- timeout 3 /nobreak >nul
- IF DEFINED dinputfound goto GTA5Modded
- @echo You are missing dinput8.dll. Importing.
- :Moddinput
- IF EXIST "D:\Games\Grand Theft Auto V\Mods" GOTO ModSkipMkDirDinput
- MKDIR "D:\Games\Grand Theft Auto V\Mods\"
- :ModSkipMkdirDinput
- MOVE /Y "D:\Games\Grand Theft Auto V\Mods\dinput8.dll" "D:\Games\Grand Theft Auto V\" >nul
- timeout 3 /nobreak >nul
- goto Modded
- :GTA5Modded
- IF DEFINED ScriptHookVFound goto ModStartGTAV
- cls
- @echo It seems you are missing ScriptHookV. Importing.
- :ModScriptHookVFound
- IF EXIST "D:\Games\Grand Theft Auto V\Mods" GOTO ModSkipMkDirScriptHook
- MKDIR "D:\Games\Grand Theft Auto V\Mods\"
- :ModSkipMkdirScriptHook
- MOVE /Y "D:\Games\Grand Theft Auto V\Mods\ScriptHookV.dll" "D:\Games\Grand Theft Auto V\" >nul
- timeout 3 /nobreak >nul
- IF EXIST "D:\Games\Grand Theft Auto V\ScriptHookV.dll" goto ModStartGTAV
- goto Modded
- :ModStartGTAV
- cls
- @echo Launching modded GTA5.
- START "" "D:\Games\Grand Theft Auto V\GTAVLauncher.exe"
- timeout 10 /nobreak >nul
- exit
- ::Script written by Jake Jensen, alias Sapphire.
- ::Contact me over reddit at /u/Sapphireex if you want more of my scripts!
- ::Script version: 1.0
- ::Script date: 4/29/2017
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement