From cf3beb6a345bdecb86d38b99b5dff10511bf1cb2 Mon Sep 17 00:00:00 2001 From: M1HA1 <67576278+M1HA15@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:42:46 +0200 Subject: [PATCH] 0.8 Release --- NSR.bat | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 90 insertions(+), 7 deletions(-) diff --git a/NSR.bat b/NSR.bat index fa2e38f..1dac03b 100644 --- a/NSR.bat +++ b/NSR.bat @@ -1,6 +1,6 @@ @echo off cls -title NSR (0.7) +title NSR (0.8) where powershell >nul 2>&1 if %errorlevel% neq 0 ( @@ -15,7 +15,7 @@ for /f "delims=" %%V in ('powershell -Command "$PSVersionTable.PSVersion.Major.T >nul 2>&1 net session || ( color 0C - echo This Script equires Administrator Privileges. + echo This Script requires Administrator Privileges. echo Please Run the Script as an Administrator! echo. echo PowerShell Version: %PSVersion% @@ -28,7 +28,7 @@ for /f "delims=" %%V in ('powershell -Command "$PSVersionTable.PSVersion.Major.T :mainMenu cls echo =============================================================================== -echo NSR (0.7) +echo NSR (0.8) echo PowerShell Version: %PSVersion% echo Running with Administrator Privileges echo =============================================================================== @@ -40,15 +40,17 @@ echo [2] Change DNS Provider echo [3] Ping DNS Provider echo [4] Info About Your PC echo [5] Info About Script -echo [6] Exit +echo [6] Bufferbloat Optimizer +echo [7] Exit echo. -set /p "choice=Enter your choice (1-6): " +set /p "choice=Enter your choice (1-7): " if "%choice%"=="1" goto :networkMaintenance if "%choice%"=="2" goto :changeDNS if "%choice%"=="3" goto :pingDNSMenu if "%choice%"=="4" goto :infoPC if "%choice%"=="5" goto :infoScript -if "%choice%"=="6" goto :exitMenu +if "%choice%"=="6" goto :bufferbloatIntro +if "%choice%"=="7" goto :exitMenu goto :mainMenu :networkMaintenance @@ -258,6 +260,87 @@ echo. pause goto :mainMenu +:bufferbloatIntro +cls +echo --------------------------------------------------------------------- +echo Bufferbloat Optimizer +echo --------------------------------------------------------------------- +echo. +echo Note: These optimizations may reduce your internet speed (both download and upload). +echo To revert the changes: download TCP Optimizer, select "Windows Default" and apply the settings. +echo Script provided by: Khorvie-Tech +echo. +set /p "skipRestartChoice=Do you want to continue? (Y/N): " +if /i "%skipRestartChoice%"=="Y" ( + goto :bufferbloatOptimizer +) else if /i "%skipRestartChoice%"=="N" ( + goto :mainMenu +) else ( + echo You have chosen an invalid option! Please select a correct option... + echo. + goto :bufferbloatIntro +) + +:bufferbloatOptimizer +cls +echo --------------------------------------------------------------------- +echo Bufferbloat Optimizer +echo --------------------------------------------------------------------- +echo. + +echo Set DNS, Local, Hosts, and NetBT priority... +reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\ServiceProvider" /v "DnsPriority" /t REG_DWORD /d 6 /f +reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\ServiceProvider" /v "LocalPriority" /t REG_DWORD /d 4 /f +reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\ServiceProvider" /v "HostsPriority" /t REG_DWORD /d 5 /f +reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\ServiceProvider" /v "NetbtPriority" /t REG_DWORD /d 7 /f + +echo. + +echo Set Network Throttling Index and System Responsiveness... +reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" /v "NetworkThrottlingIndex" /t REG_DWORD /d 0xffffffff /f +reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" /v "SystemResponsiveness" /t REG_DWORD /d 0 /f + +echo. + +echo Set MaxUserPort, TcpTimedWaitDelay, and DefaultTTL... +reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "MaxUserPort" /t REG_DWORD /d 65534 /f +reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "TcpTimedWaitDelay" /t REG_DWORD /d 30 /f +reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "DefaultTTL" /t REG_DWORD /d 64 /f + +echo. + +echo PowerShell commands for TCP settings... +PowerShell.exe Set-NetTCPSetting -SettingName internet -AutoTuningLevelLocal disabled +PowerShell.exe Set-NetTCPSetting -SettingName internet -ScalingHeuristics disabled +PowerShell.exe Set-NetTcpSetting -SettingName internet -EcnCapability enabled +PowerShell.exe Set-NetTcpSetting -SettingName internet -Timestamps enabled +PowerShell.exe Set-NetTcpSetting -SettingName internet -MaxSynRetransmissions 2 +PowerShell.exe Set-NetTcpSetting -SettingName internet -NonSackRttResiliency disabled +PowerShell.exe Set-NetTcpSetting -SettingName internet -InitialRto 2000 +PowerShell.exe Set-NetTcpSetting -SettingName internet -MinRto 300 + +echo. + +echo PowerShell commands for offload and network settings... +PowerShell.exe Set-NetOffloadGlobalSetting -ReceiveSegmentCoalescing disabled +PowerShell.exe Set-NetOffloadGlobalSetting -ReceiveSideScaling disabled +PowerShell.exe Set-NetOffloadGlobalSetting -Chimney disabled +PowerShell.exe Disable-NetAdapterLso -Name * +PowerShell.exe Disable-NetAdapterChecksumOffload -Name * + +echo. + +echo netsh commands for TCP settings and MTU... +netsh int tcp set supplemental internet congestionprovider=ctcp +netsh interface ipv4 set subinterface "Wi-Fi" mtu=1500 store=persistent +netsh interface ipv6 set subinterface "Wi-Fi" mtu=1500 store=persistent +netsh interface ipv4 set subinterface "Ethernet" mtu=1500 store=persistent +netsh interface ipv6 set subinterface "Ethernet" mtu=1500 store=persistent + +echo Optimizations have been successfully applied! +pause +goto :mainMenu + :infoPC cls echo --------------------------------------------------------------------- @@ -276,7 +359,7 @@ echo Info About Script echo --------------------------------------------------------------------- echo. echo Script Name: NSR -echo Version: 0.7 +echo Version: 0.8 echo Author: M1HA15 echo Beta Version: %betaVersion% echo.