Skip to content

Commit

Permalink
fix: update reset network to atlas default script
Browse files Browse the repository at this point in the history
  • Loading branch information
Xyueta committed Aug 2, 2023
1 parent 12e6876 commit 1779f8f
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ whoami /user | find /i "S-1-5-18" > nul 2>&1 || (
)

echo This will break a majority of UWP apps and their deployment.
echo Extra note: This breaks the "about" page in Immersive Control Panel. If you require it, enable the AppX service.
echo Extra note: This breaks the "About" page in Immersive Control Panel. If you require it, enable the AppX service.
pause

:: Detect if user is using a Microsoft account
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ whoami /user | find /i "S-1-5-18" > nul 2>&1 || (
exit /b
)

:printECont
:: add print to context menu
:: Add print to context menu
reg delete "HKCR\SystemFileAssociations\image\shell\print" /v "ProgrammaticAccessOnly" /f > nul 2>&1
for %%a in (
"batfile"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,44 +25,104 @@ reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient" /v "EnableMultic
:: Set default power saving mode for all network cards to disabled
reg add "HKLM\SYSTEM\CurrentControlSet\Services\NDIS\Parameters" /v "DefaultPnPCapabilities" /t REG_DWORD /d "24" /f > nul 2>&1

:: Configure NIC settings
for /f %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class" /v "*WakeOnMagicPacket" /s ^| findstr "HKEY"') do (
for %%i in (
"*EEE"
"*FlowControl"
"*LsoV2IPv4"
"*LsoV2IPv6"
"*SelectiveSuspend"
"*WakeOnMagicPacket"
"*WakeOnPattern"
"AdvancedEEE"
"AutoDisableGigabit"
"AutoPowerSaveModeEnabled"
"EnableConnectedPowerGating"
"EnableDynamicPowerGating"
"EnableGreenEthernet"
"EnableModernStandby"
"EnablePME"
"EnablePowerManagement"
"EnableSavePowerNow"
"GigaLite"
"PowerSavingMode"
"ReduceSpeedOnPowerDown"
"ULPMode"
"WakeOnLink"
"WakeOnSlot"
"WakeUpModeCap"
) do (
for /f %%j in ('reg query "%%a" /v "%%~i" ^| findstr "HKEY"') do (
reg add "%%j" /v "%%~i" /t REG_SZ /d "0" /f > nul 2>&1
)
:: Set network adapter driver registry key
for /f %%a in ('wmic path Win32_NetworkAdapter get PNPDeviceID^| findstr /L "PCI\VEN_"') do (
for /f "tokens=3" %%b in ('reg query "HKLM\SYSTEM\CurrentControlSet\Enum\%%a" /v "Driver"') do (
set "netKey=HKLM\SYSTEM\CurrentControlSet\Control\Class\%%b"
)
)

:: Configure internet adapter settings
:: Dump of all possible settings found
:: TO DO: revise and document each setting
for %%a in (
"AdvancedEEE"
"AlternateSemaphoreDelay"
"ApCompatMode"
"ARPOffloadEnable"
"AutoDisableGigabit"
"AutoPowerSaveModeEnabled"
"bAdvancedLPs"
"bLeisurePs"
"bLowPowerEnable"
"DeviceSleepOnDisconnect"
"DMACoalescing"
"EEE"
"EEELinkAdvertisement"
"EeePhyEnable"
"Enable9KJFTpt"
"EnableConnectedPowerGating"
"EnableDynamicPowerGating"
"EnableEDT"
"EnableGreenEthernet"
"EnableModernStandby"
"EnablePME"
"EnablePowerManagement"
"EnableSavePowerNow"
"EnableWakeOnLan"
"FlowControl"
"FlowControlCap"
"GigaLite"
"GPPSW"
"GTKOffloadEnable"
"InactivePs"
"LargeSendOffload"
"LargeSendOffloadJumboCombo"
"LogLevelWarn"
"LsoV1IPv4"
"LsoV2IPv4"
"LsoV2IPv6"
"MasterSlave"
"ModernStandbyWoLMagicPacket"
"MPC"
"NicAutoPowerSaver"
"Node"
"NSOffloadEnable"
"PacketCoalescing"
rem Offload "PMARPOffload"
rem Offload "PMNSOffload"
"PMWiFiRekeyOffload"
"PowerDownPll"
"PowerSaveMode"
"PowerSavingMode"
"PriorityVLANTag"
"ReduceSpeedOnPowerDown"
"S5WakeOnLan"
"SavePowerNowEnabled"
"SelectiveSuspend"
"SipsEnabled"
"uAPSDSupport"
"ULPMode"
"WaitAutoNegComplete"
"WakeOnDisconnect"
"WakeOnLink"
"WakeOnMagicPacket"
"WakeOnPattern"
"WakeOnSlot"
"WakeUpModeCap"
"WoWLANLPSLevel"
"WoWLANS5Support"
) do (
rem Check without '*'
for /f %%b in ('reg query "!netKey!" /v "%%~a" ^| findstr "HKEY"') do (
reg add "!netKey!" /v "%%~a" /t REG_SZ /d "0" /f
)
rem Check with '*'
for /f %%b in ('reg query "!netKey!" /v "*%%~a" ^| findstr "HKEY"') do (
reg add "!netKey!" /v "*%%~a" /t REG_SZ /d "0" /f
)
)

:: Configure netsh settings
netsh int tcp set heuristics disabled
netsh int tcp set supplemental Internet congestionprovider=ctcp
netsh int tcp set global rsc=disabled
netsh interface Teredo set state type=enterpriseclient
netsh interface Teredo set state servername=default

for /f "tokens=1" %%a in ('netsh int ip show interfaces ^| findstr [0-9]') do (
netsh int ip set interface %%a routerdiscovery=disabled store=persistent
)

echo Finished, please reboot your device for changes to apply.
pause
Expand Down

0 comments on commit 1779f8f

Please sign in to comment.