From dd244c6a250beda7981206134613dee32dd9ff5b Mon Sep 17 00:00:00 2001 From: Toastcode <67870123+ToastcodeDev@users.noreply.github.com> Date: Tue, 11 Nov 2025 12:58:14 -0400 Subject: [PATCH] Update script to fix CPU load for NFS Heat --- nfs_hits_cpu90_fix.cmd | 44 +++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/nfs_hits_cpu90_fix.cmd b/nfs_hits_cpu90_fix.cmd index c832a6f..e5c3797 100644 --- a/nfs_hits_cpu90_fix.cmd +++ b/nfs_hits_cpu90_fix.cmd @@ -1,23 +1,30 @@ @echo off -title = Fix 90%% load for NEED FOR SPEED HEAT. by Octanium -set "CPU_Cores=0" -set "CPU_Threads=0" +title Fix 90%% load for NEED FOR SPEED HEAT by Octanium, Toastcode +setlocal enabledelayedexpansion + set "UserCFGFileCDDir=%~dp0" set "UserCFGFileName=user.cfg" set "UserCFGFile=%UserCFGFileCDDir%%UserCFGFileName%" -for /f "tokens=*" %%a in ('powershell -Command "Get-CimInstance -ClassName Win32_Processor | Select-Object -ExpandProperty NumberOfCores"') do set "CPU_Cores=%%a" -for /f "tokens=*" %%a in ('powershell -Command "Get-CimInstance -ClassName Win32_Processor | Select-Object -ExpandProperty NumberOfLogicalProcessors"') do set "CPU_Threads=%%a" -if %CPU_Cores% == 0 goto oops_a + +rem ======== Using PowerShell Method ========= +for /f %%a in ('powershell -command "(Get-CimInstance Win32_Processor).NumberOfCores"') do set "CPU_Cores=%%a" +for /f %%a in ('powershell -command "(Get-CimInstance Win32_Processor).NumberOfLogicalProcessors"') do set "CPU_Threads=%%a" + +if "%CPU_Cores%"=="" goto oops_a +if "%CPU_Threads%"=="" goto oops_a + echo. echo Fix 90%% CPU load! echo For game NEED FOR SPEED HEAT -echo by Octanium +echo by Octanium and Toastcode echo. echo ==== Your CPU ==== echo CPU cores : %CPU_Cores% echo CPU threads: %CPU_Threads% echo ================== -REM Create user.cfg +echo. + +rem ======== Crear user.cfg ========= if exist "%UserCFGFile%" ( if exist "%UserCFGFileCDDir%%UserCFGFileName%.bak" ( del "%UserCFGFile%" /q /f @@ -25,23 +32,25 @@ if exist "%UserCFGFile%" ( rename "%UserCFGFileCDDir%%UserCFGFileName%" "%UserCFGFileName%.bak" ) ) -echo Thread.ProcessorCount %CPU_Cores% >> "%UserCFGFile%" -echo Thread.MaxProcessorCount %CPU_Cores% >> "%UserCFGFile%" -echo Thread.MinFreeProcessorCount 0 >> "%UserCFGFile%" -echo Thread.JobThreadPriority 0 >> "%UserCFGFile%" -echo GstRender.Thread.MaxProcessorCount %CPU_Threads% >> "%UserCFGFile%" + +( +echo Thread.ProcessorCount %CPU_Cores% +echo Thread.MaxProcessorCount %CPU_Cores% +echo Thread.MinFreeProcessorCount 0 +echo Thread.JobThreadPriority 0 +echo GstRender.Thread.MaxProcessorCount %CPU_Threads% +) > "%UserCFGFile%" + if exist "%UserCFGFile%" ( echo. echo ============================= echo File user.cfg created! echo ============================= - echo. - ) else ( +) else ( echo. echo ============================= echo File user.cfg NOT created! echo ============================= - echo. ) pause exit @@ -53,6 +62,5 @@ echo ============================================= echo Oooops something went wrong :( (code: a) echo ============================================= echo. -echo. pause -exit \ No newline at end of file +exit