-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathForzaHorizon4.bat
46 lines (38 loc) · 1.33 KB
/
ForzaHorizon4.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
@echo off
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
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"
echo Executing ForzaHorizonFix (v2.0) by @paxanddos.
echo If you have any issues please address them to https://github.com/PAXANDDOS/ForzaHorizonFix/issues
echo Waiting for Forza Horizon 4 to finally launch and then killing explorer.exe.
net start XboxNetApiSvc
net start XboxGipSvc
net start XblAuthManager
net start XblGameSave
timeout /T 1 /NOBREAK
start /high explorer.exe shell:appsFolder\Microsoft.SunriseBaseGame_8wekyb3d8bbwe!SunriseReleaseFinal
SetLocal EnableExtensions
SetLocal ENABLEDELAYEDEXPANSION
Set game=ForzaHorizon4.exe
timeout /T 60 /NOBREAK
taskkill /f /im explorer.exe
:loop
tasklist | Find /i "%game%" || (goto Else)
:THEN
timeout /T 5 /NOBREAK
goto loop
:ELSE
start explorer.exe
exit