Skip to content

Commit

Permalink
0.8 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
M1HA15 authored Nov 15, 2024
1 parent 52b5f51 commit cf3beb6
Showing 1 changed file with 90 additions and 7 deletions.
97 changes: 90 additions & 7 deletions NSR.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@echo off
cls
title NSR (0.7)
title NSR (0.8)

where powershell >nul 2>&1
if %errorlevel% neq 0 (
Expand All @@ -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%
Expand All @@ -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 ===============================================================================
Expand All @@ -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
Expand Down Expand Up @@ -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 ---------------------------------------------------------------------
Expand All @@ -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.
Expand Down

0 comments on commit cf3beb6

Please sign in to comment.