forked from LeDragoX/Win-Debloat-Tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split optimize-privacy-and-performance in 2 files
- Add space between file versions - (Personal) Fix hide chat icon on WIndows 11 taskbar 🤦♂️ (stupid error)
- Loading branch information
Showing
6 changed files
with
133 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"file-runner.psm1" | ||
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1" | ||
|
||
# Adapted from: https://youtu.be/hQSkPmZRCjc | ||
# Adapted from: https://github.com/ChrisTitusTech/win10script | ||
# Adapted from: https://github.com/Sycnex/Windows10Debloater | ||
|
||
function Optimize-Performance() { | ||
[CmdletBinding()] | ||
param( | ||
[Switch] $Revert, | ||
[Int] $Zero = 0, | ||
[Int] $One = 1, | ||
[Array] $EnableStatus = @( | ||
"[-][Performance] Disabling", | ||
"[+][Performance] Enabling" | ||
) | ||
) | ||
|
||
If (($Revert)) { | ||
Write-Host "[<][Privacy/Performance] Reverting: $Revert." -ForegroundColor Yellow -BackgroundColor Black | ||
$Zero = 1 | ||
$One = 0 | ||
$EnableStatus = @( | ||
"[<][Performance] Re-Enabling", | ||
"[<][Performance] Re-Disabling" | ||
) | ||
} | ||
|
||
# Initialize all Path variables used to Registry Tweaks | ||
$PathToLMPoliciesPsched = "HKLM:\SOFTWARE\Policies\Microsoft\Psched" | ||
$PathToLMPoliciesWindowsStore = "HKLM:\SOFTWARE\Policies\Microsoft\WindowsStore" | ||
$PathToLMPrefetchParams = "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters" | ||
$PathToCUGameBar = "HKCU:\SOFTWARE\Microsoft\GameBar" | ||
|
||
Write-Title -Text "Performance Tweaks" | ||
|
||
Write-Section -Text "Gaming" | ||
Write-Host "$($EnableStatus[0]) Game Bar & Game DVR..." | ||
$Scripts = @("disable-game-bar-dvr.reg") | ||
If ($Revert) { | ||
$Scripts = @("enable-game-bar-dvr.reg") | ||
} | ||
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts $Scripts -DoneTitle "" -DoneMessage "" -NoDialog | ||
|
||
Write-Host "[=][Performance] Enabling game mode..." | ||
Set-ItemProperty -Path "$PathToCUGameBar" -Name "AllowAutoGameMode" -Type DWord -Value 1 | ||
Set-ItemProperty -Path "$PathToCUGameBar" -Name "AutoGameModeEnabled" -Type DWord -Value 1 | ||
|
||
Write-Section -Text "System" | ||
Write-Caption -Text "Display" | ||
Write-Host "[+][Performance] Enable Hardware Accelerated GPU Scheduling... (Windows 10 20H1+ - Needs Restart)" | ||
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -Name "HwSchMode" -Type DWord -Value 2 | ||
|
||
Write-Host "$($EnableStatus[0]) SysMain/Superfetch..." | ||
# As SysMain was already disabled on the Services, just need to remove it's key | ||
# [@] (0 = Disable SysMain, 1 = Enable when program is launched, 2 = Enable on Boot, 3 = Enable on everything) | ||
Set-ItemProperty -Path "$PathToLMPrefetchParams" -Name "EnableSuperfetch" -Type DWord -Value $Zero | ||
|
||
Write-Host "$($EnableStatus[0]) Remote Assistance..." | ||
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Type DWord -Value $Zero | ||
|
||
Write-Host "[-][Performance] Disabling Ndu High RAM Usage..." | ||
# [@] (2 = Enable Ndu, 4 = Disable Ndu) | ||
Set-ItemProperty -Path "HKLM:\SYSTEM\ControlSet001\Services\Ndu" -Name "Start" -Type DWord -Value 4 | ||
|
||
# Details: https://www.tenforums.com/tutorials/94628-change-split-threshold-svchost-exe-windows-10-a.html | ||
# Will reduce Processes number considerably on > 4GB of RAM systems | ||
Write-Host "[+][Performance] Setting SVCHost to match RAM size..." | ||
$RamInKB = (Get-CimInstance -ClassName Win32_PhysicalMemory | Measure-Object -Property Capacity -Sum).Sum / 1KB | ||
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control" -Name "SvcHostSplitThresholdInKB" -Type DWord -Value $RamInKB | ||
|
||
Write-Host "[+][Performance] Unlimiting your network bandwidth for all your system..." # Based on this Chris Titus video: https://youtu.be/7u1miYJmJ_4 | ||
If (!(Test-Path "$PathToLMPoliciesPsched")) { | ||
New-Item -Path "$PathToLMPoliciesPsched" -Force | Out-Null | ||
} | ||
Set-ItemProperty -Path "$PathToLMPoliciesPsched" -Name "NonBestEffortLimit" -Type DWord -Value 0 | ||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" -Name "NetworkThrottlingIndex" -Type DWord -Value 0xffffffff | ||
|
||
Write-Host "[=][Performance] Enabling Windows Store apps Automatic Updates..." | ||
If (!(Test-Path "$PathToLMPoliciesWindowsStore")) { | ||
New-Item -Path "$PathToLMPoliciesWindowsStore" -Force | Out-Null | ||
} | ||
If ((Get-Item "$PathToLMPoliciesWindowsStore").GetValueNames() -like "AutoDownload") { | ||
Remove-ItemProperty -Path "$PathToLMPoliciesWindowsStore" -Name "AutoDownload" # [@] (2 = Disable, 4 = Enable) | ||
} | ||
|
||
Write-Section -Text "Power Plan Tweaks" | ||
Write-Host "[+][Performance] Setting Power Plan to High Performance..." | ||
powercfg -setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c | ||
|
||
# Found on the registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\User\Default\PowerSchemes | ||
Write-Host "[+][Performance] Enabling (Not setting) the Ultimate Performance Power Plan..." | ||
powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61 | ||
|
||
Write-Section -Text "Network & Internet" | ||
Write-Caption -Text "Proxy" | ||
Write-Host "[-][Performance] Fixing Edge slowdown by NOT Automatically Detecting Settings..." | ||
# Code from: https://www.reddit.com/r/PowerShell/comments/5iarip/set_proxy_settings_to_automatically_detect/?utm_source=share&utm_medium=web2x&context=3 | ||
$key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections' | ||
$data = (Get-ItemProperty -Path $key -Name DefaultConnectionSettings).DefaultConnectionSettings | ||
$data[8] = 3 | ||
Set-ItemProperty -Path $key -Name DefaultConnectionSettings -Value $data | ||
|
||
} | ||
|
||
function Main() { | ||
If (!($Revert)) { | ||
Optimize-Performance # Setup registries that slowdowns the system | ||
} | ||
Else { | ||
Optimize-Performance -Revert | ||
} | ||
} | ||
|
||
Main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters