debloat & tweaks
debloat & tweaks
# Pre Customizations
#########
function Show-Choco-Menu {
param(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$Title,
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$ChocoInstall
)
do
{
Clear-Host
Write-Host "================ $Title ================"
Write-Host "Y: Press 'Y' to do this."
Write-Host "2: Press 'N' to skip this."
Write-Host "Q: Press 'Q' to stop the entire script."
$selection = Read-Host "Please make a selection"
switch ($selection)
{
'y' { choco install $ChocoInstall -y }
'n' { Break }
'q' { Exit }
}
}
until ($selection -match "y" -or $selection -match "n" -or $selection -match "q")
}
Function SlowUpdatesTweaks {
Write-Output "Improving Windows Update to delay Feature updates and only
install Security Updates"
### Fix Windows Update to delay feature updates and only update at certain
times
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
WindowsUpdate" -Name "BranchReadinessLevel" -ErrorAction SilentlyContinue | Out-
Null
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\
Settings" -Name "BranchReadinessLevel" -ErrorAction SilentlyContinue | Out-Null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
WindowsUpdate" -Name "DeferFeatureUpdates" -Type DWord -Value 1 -ErrorAction
SilentlyContinue | Out-Null
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\
Settings" -Name "DeferFeatureUpdates" -ErrorAction SilentlyContinue | Out-Null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
WindowsUpdate" -Name "DeferQualityUpdates" -Type DWord -Value 1 -ErrorAction
SilentlyContinue | Out-Null
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\
Settings" -Name "DeferQualityUpdates" -ErrorAction SilentlyContinue | Out-Null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
WindowsUpdate" -Name "DeferFeatureUpdatesPeriodInDays" -Type DWord -Value 30d -
ErrorAction SilentlyContinue | Out-Null
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\
Settings" -Name "DeferFeatureUpdatesPeriodInDays" -ErrorAction SilentlyContinue |
Out-Null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
WindowsUpdate" -Name "DeferQualityUpdatesPeriodInDays" -Type DWord -Value 4d -
ErrorAction SilentlyContinue | Out-Null
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\
Settings" -Name "DeferQualityUpdatesPeriodInDays" -ErrorAction SilentlyContinue |
Out-Null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
WindowsUpdate" -Name "PauseFeatureUpdatesStartTime" -Type String -Value "" -
ErrorAction SilentlyContinue | Out-Null
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\
Settings" -Name "PauseFeatureUpdatesStartTime" -ErrorAction SilentlyContinue | Out-
Null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
WindowsUpdate" -Name "PauseQualityUpdatesStartTime" -Type String -Value "" -
ErrorAction SilentlyContinue | Out-Null
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\
Settings" -Name "PauseQualityUpdatesStartTime" -ErrorAction SilentlyContinue | Out-
Null
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
WindowsUpdate" -Name "ActiveHoursEnd" -ErrorAction SilentlyContinue | Out-Null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -
Name "ActiveHoursEnd" -Type DWord -Value 2 -ErrorAction SilentlyContinue | Out-Null
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
WindowsUpdate" -Name "ActiveHoursStart" -ErrorAction SilentlyContinue | Out-Null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -
Name "ActiveHoursStart" -Type DWord -Value 8 -ErrorAction SilentlyContinue | Out-
Null
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\
UpdatePolicy\Settings" -Name "PausedQualityDate" -ErrorAction SilentlyContinue |
Out-Null
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\
UpdatePolicy\Settings" -Name "PausedFeatureDate" -ErrorAction SilentlyContinue |
Out-Null
}
[Parameter(Mandatory=$False,Position=1,ValueFromPipeline=$True,ValueFromPipelinebyP
ropertyName=$True)][Object] $Object,
[Parameter(Mandatory=$False,Position=2,ValueFromPipeline=$True,ValueFromPipelinebyP
ropertyName=$True)][ConsoleColor] $ForegroundColor,
[Parameter(Mandatory=$False,Position=3,ValueFromPipeline=$True,ValueFromPipelinebyP
ropertyName=$True)][ConsoleColor] $BackgroundColor,
[Switch]$NoNewline
)
if($NoNewline)
{
[Console]::Write($Object)
}
else
{
Write-Output $Object
}
Function InstallTitusProgs {
Write-Output "Installing Chocolatey"
Set-ExecutionPolicy Bypass -Scope Process -Force;
[System.Net.ServicePointManager]::SecurityProtocol =
[System.Net.ServicePointManager]::SecurityProtocol -bor 3072; Invoke-Expression
((New-Object
System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install chocolatey-core.extension -y
Write-Output "Running O&O Shutup with Recommended Settings"
Import-Module BitsTransfer
Start-BitsTransfer -Source
"https://raw.githubusercontent.com/DaddyMadu/Windows10GamingFocus/master/
ooshutup10.cfg" -Destination ooshutup10.cfg
Start-BitsTransfer -Source
"https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe" -Destination OOSU10.exe
./OOSU10.exe ooshutup10.cfg /quiet
Start-Sleep -Second 10
remove-item ooshutup10.cfg -force -Recurse -ErrorAction SilentlyContinue
remove-item OOSU10.exe -force -Recurse -ErrorAction SilentlyContinue
}
# Install the latest Microsoft Visual C++ 2010-2019 Redistributable Packages and
Silverlight
Function InstallMVC {
choco install -y vcredist2010 | Out-Null
}
Function InstallSumatra {
Show-Choco-Menu -Title "Do you want to install lightweight Sumatra PDF
Reader?" -ChocoInstall "sumatrapdf"
}
Function InstallChrome {
Show-Choco-Menu -Title "Do you want to install Google Chrome Browser?" -
ChocoInstall "googlechrome"
}
Function Install7Zip {
Choco Install 7zip -y
}
Function InstallNotepadplusplus {
Show-Choco-Menu -Title "Do you want to install Notepad++?" -ChocoInstall
"notepadplusplus"
}
Function InstallVLC {
Show-Choco-Menu -Title "Do you want to install VLC?" -ChocoInstall "vlc"
}
Function InstallIrfanview {
Show-Choco-Menu -Title "Do you want to install IrfanView PhotoViewer?" -
ChocoInstall "irfanview"
}
Function InstallChocoUpdates {
Clear-Host
choco upgrade all -y
}
Function ChangeDefaultApps {
Write-Output "Setting Default Programs - Notepad++ Brave VLC IrFanView"
Start-BitsTransfer -Source
"https://raw.githubusercontent.com/DaddyMadu/Windows10GamingFocus/master/
MyDefaultAppAssociations.xml" -Destination $HOME\Desktop\
MyDefaultAppAssociations.xml
dism /online /Import-DefaultAppAssociations:"%UserProfile%\Desktop\
MyDefaultAppAssociations.xml"
}
#Apply PC Optimizations
Function ApplyPCOptimizations {
Write-Output "Applying PC Optimizations..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\
Multimedia\SystemProfile" -Name "SystemResponsiveness" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\
Multimedia\SystemProfile" -Name "NetworkThrottlingIndex" -Type DWord -Value 10
}
}
#Enable Or Disable MSI Mode For Supported Cards, WARNING ENABLING MSI MODE MIGHT
CRUSH YOUR SYSTEM! IF IT HAPPENS PLEASE RESTORE LAST WORKING SYSTEM RESTORE POINT
AND DON'T ENABLE MSI MODE ON THIS SYSTEM AGAIN!
Function MSIMode {
$errpref = $ErrorActionPreference #save actual preference
$ErrorActionPreference = "silentlycontinue"
$GPUIDS = @(
(wmic path win32_VideoController get PNPDeviceID | Select-Object -Skip 2 | Format-
List | Out-String).Trim()
)
foreach ($GPUID in $GPUIDS) {
$CheckDeviceDes = (Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\
$GPUID").DeviceDesc
} if(($CheckDeviceDes -like "*GTX*") -or ($CheckDeviceDes -like "*RTX*") -or
($CheckDeviceDes -like "*AMD*")) {
'GTX/RTX/AMD Compatible Card Found! Enabling MSI Mode...'
New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$GPUID\Device Parameters\
Interrupt Management\MessageSignaledInterruptProperties\" -Force | Out-Null
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$GPUID\Device
Parameters\Interrupt Management\MessageSignaledInterruptProperties\" -Name
"MSISupported" -Type DWord -Value 1
} else {
'No GTX/RTX/AMD Compatible Card Found! Skiping...'
}
$ErrorActionPreference = $errpref #restore previous preference
}
##########
# Privacy Tweaks
##########
# Disable Telemetry
# Note: This tweak may cause Enterprise edition to stop receiving Windows updates.
# Windows Update control panel will then show message "Your device is at risk
because it's out of date and missing important security and quality updates. Let's
get you back on track so Windows can run more securely. Select this button to get
going".
# In such case, enable telemetry, run Windows update and then disable telemetry
again. See also
https://github.com/Disassembler0/Win10-Initial-Setup-Script/issues/57
Function DisableTelemetry {
Write-Output "Disabling Telemetry..."
$errpref = $ErrorActionPreference #save actual preference
$ErrorActionPreference = "silentlycontinue"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\
CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
Disable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\
Microsoft Compatibility Appraiser" | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\
ProgramDataUpdater" | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\Autochk\Proxy" | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience
Improvement Program\Consolidator" | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience
Improvement Program\UsbCeip" | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\DiskDiagnostic\Microsoft-
Windows-DiskDiagnosticDataCollector" | Out-Null
$ErrorActionPreference = $errpref #restore previous preference
}
# Enable Telemetry
Function EnableTelemetry {
Write-Output "Enabling Telemetry..."
$errpref = $ErrorActionPreference #save actual preference
$ErrorActionPreference = "silentlycontinue"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 3
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\
CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 3
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
DataCollection" -Name "AllowTelemetry" -ErrorAction SilentlyContinue
Enable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\
Microsoft Compatibility Appraiser" | Out-Null
Enable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\
ProgramDataUpdater" | Out-Null
Enable-ScheduledTask -TaskName "Microsoft\Windows\Autochk\Proxy" | Out-Null
Enable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience
Improvement Program\Consolidator" | Out-Null
Enable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience
Improvement Program\UsbCeip" | Out-Null
Enable-ScheduledTask -TaskName "Microsoft\Windows\DiskDiagnostic\Microsoft-
Windows-DiskDiagnosticDataCollector" | Out-Null
$ErrorActionPreference = $errpref #restore previous preference
}
# Disable Activity History feed in Task View - Note: The checkbox "Let Windows
collect my activities from this PC" remains checked even when the function is
disabled
Function DisableActivityHistory {
Write-Output "Disabling Activity History..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -
Name "EnableActivityFeed" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -
Name "PublishUserActivities" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -
Name "UploadUserActivities" -Type DWord -Value 0
}
# Disable Background application access - ie. if apps can download or update when
they aren't used - Cortana is excluded as its inclusion breaks start menu search
Function DisableBackgroundApps {
Write-Output "Disabling Background application access..."
Get-ChildItem -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\
BackgroundAccessApplications" -Exclude "Microsoft.Windows.Cortana*" | ForEach-
Object {
Set-ItemProperty -Path $_.PsPath -Name "Disabled" -Type DWord -Value 1
Set-ItemProperty -Path $_.PsPath -Name "DisabledByUser" -Type DWord -
Value 1
}
}
# Disable Feedback
Function DisableFeedback {
Write-Output "Disabling Feedback..."
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules")) {
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Force | Out-Null
}
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Name
"NumberOfSIUFInPeriod" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
DataCollection" -Name "DoNotShowFeedbackNotifications" -Type DWord -Value 1
Disable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClient" -
ErrorAction SilentlyContinue | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\
DmClientOnScenarioDownload" -ErrorAction SilentlyContinue | Out-Null
}
# Enable Feedback
Function EnableFeedback {
Write-Output "Enabling Feedback..."
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Name
"NumberOfSIUFInPeriod" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
DataCollection" -Name "DoNotShowFeedbackNotifications" -ErrorAction
SilentlyContinue
Enable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClient" -
ErrorAction SilentlyContinue | Out-Null
Enable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\
DmClientOnScenarioDownload" -ErrorAction SilentlyContinue | Out-Null
}
# Disable Advertising ID
Function DisableAdvertisingID {
Write-Output "Disabling Advertising ID..."
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo"))
{
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
AdvertisingInfo" | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
AdvertisingInfo" -Name "DisabledByGroupPolicy" -Type DWord -Value 1
}
# Enable Advertising ID
Function EnableAdvertisingID {
Write-Output "Enabling Advertising ID..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
AdvertisingInfo" -Name "DisabledByGroupPolicy" -ErrorAction SilentlyContinue
}
# Disable Cortana
Function DisableCortana {
Write-Output "Disabling Cortana..."
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings")) {
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -
Force | Out-Null
}
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -
Name "AcceptedPrivacyPolicy" -Type DWord -Value 0
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization")) {
New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Force |
Out-Null
}
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name
"RestrictImplicitTextCollection" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name
"RestrictImplicitInkCollection" -Type DWord -Value 1
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\
TrainedDataStore")) {
New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\
TrainedDataStore" -Force | Out-Null
}
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\
TrainedDataStore" -Name "HarvestContacts" -Type DWord -Value 0
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search"))
{
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows
Search" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows
Search" -Name "AllowCortana" -Type DWord -Value 0
}
# Enable Cortana
Function EnableCortana {
Write-Output "Enabling Cortana..."
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings"
-Name "AcceptedPrivacyPolicy" -ErrorAction SilentlyContinue
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\
TrainedDataStore")) {
New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\
TrainedDataStore" -Force | Out-Null
}
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name
"RestrictImplicitTextCollection" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name
"RestrictImplicitInkCollection" -Type DWord -Value 0
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\
TrainedDataStore" -Name "HarvestContacts" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows
Search" -Name "AllowCortana" -ErrorAction SilentlyContinue
}
# Restrict Windows Update P2P only to local network - Needed only for 1507 as local
P2P is the default since 1511
Function SetP2PUpdateLocal {
Write-Output "Restricting Windows Update P2P only to local network..."
$errpref = $ErrorActionPreference #save actual preference
$ErrorActionPreference = "silentlycontinue"
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
DeliveryOptimization\Config")) {
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
DeliveryOptimization\Config" | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 1 | Out-Null
-ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
DeliveryOptimization" -Name "DODownloadMode" -Type DWord -Value 1 -Force | Out-Null
$ErrorActionPreference = $errpref #restore previous preference
}
##########
# Security Tweaks
##########
# Disable SMB Server - Completely disables file and printer sharing, but leaves the
system able to connect to another SMB server as a client
Function DisableSMBServer {
Write-Output "Disabling SMB Server..."
Set-SmbServerConfiguration -EnableSMB1Protocol $false -Force
Set-SmbServerConfiguration -EnableSMB2Protocol $false -Force
}
# Set current network profile to private (allow file sharing, device discovery,
etc.)
Function SetCurrentNetworkPrivate {
Write-Output "Setting current network profile to private..."
Set-NetConnectionProfile -NetworkCategory Private
}
# Set current network profile to public (deny file sharing, device discovery, etc.)
Function SetCurrentNetworkPublic {
Write-Output "Setting current network profile to public..."
Set-NetConnectionProfile -NetworkCategory Public
}
# Set unknown networks profile to private (allow file sharing, device discovery,
etc.)
Function SetUnknownNetworksPrivate {
Write-Output "Setting unknown networks profile to private..."
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\
NetworkList\Signatures\
010103000F0000F0010000000F0000F0C967A3643C3AD745950DA7859209176EF5B87C875FA20DF2195
1640E807D7C24")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\
CurrentVersion\NetworkList\Signatures\
010103000F0000F0010000000F0000F0C967A3643C3AD745950DA7859209176EF5B87C875FA20DF2195
1640E807D7C24" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\
CurrentVersion\NetworkList\Signatures\
010103000F0000F0010000000F0000F0C967A3643C3AD745950DA7859209176EF5B87C875FA20DF2195
1640E807D7C24" -Name "Category" -Type DWord -Value 1
}
# Set unknown networks profile to public (deny file sharing, device discovery,
etc.)
Function SetUnknownNetworksPublic {
Write-Output "Setting unknown networks profile to public..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\
CurrentVersion\NetworkList\Signatures\
010103000F0000F0010000000F0000F0C967A3643C3AD745950DA7859209176EF5B87C875FA20DF2195
1640E807D7C24" -Name "Category" -ErrorAction SilentlyContinue
}
do
{
Clear-Host
Write-Host "================ Do you want to Disable Microsoft Windows Defender?
================"
Write-Host "Y: Press 'Y' to Disable Microsoft Windows Defender."
Write-Host "N: Press 'N' to Enable Microsoft Windows Defender."
Write-Host "Q: Press 'Q' to Skip this."
$selection = Read-Host "Please make a selection"
switch ($selection)
{
'y' {
Write-Output "Disabling Microsoft Windows Defender and related Processes..."
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\WindowsFirewall\
StandardProfile")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\WindowsFirewall\
StandardProfile" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\WindowsFirewall\
StandardProfile" -Name "EnableFirewall" -Type DWord -Value 0
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -
Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -
Name "DisableAntiSpyware" -Type DWord -Value 1
If ([System.Environment]::OSVersion.Version.Build -eq 14393) {
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\
CurrentVersion\Run" -Name "WindowsDefender" -ErrorAction SilentlyContinue
} ElseIf ([System.Environment]::OSVersion.Version.Build -ge 15063) {
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\
CurrentVersion\Run" -Name "SecurityHealth" -ErrorAction SilentlyContinue
}
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet"))
{
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\
Spynet" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\
Spynet" -Name "SpynetReporting" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\
Spynet" -Name "SubmitSamplesConsent" -Type DWord -Value 2
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows
Defender" -Name "PUAProtection" -ErrorAction SilentlyContinue
Set-MpPreference -EnableControlledFolderAccess Disabled -ErrorAction
SilentlyContinue
Disable-ScheduledTask -TaskName "\Microsoft\Windows\Windows Defender\Windows
Defender Cache Maintenance" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\Windows Defender\Windows
Defender Cleanup" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\Windows Defender\Windows
Defender Scheduled Scan" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\Windows Defender\Windows
Defender Verification" | Out-Null
Clear-Host
}
'n' {
Write-Output "Enabling Microsoft Windows Defender and related Processes..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\WindowsFirewall\
StandardProfile" -Name "EnableFirewall" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows
Defender" -Name "DisableAntiSpyware" -ErrorAction SilentlyContinue
If ([System.Environment]::OSVersion.Version.Build -eq 14393) {
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\
CurrentVersion\Run" -Name "WindowsDefender" -Type ExpandString -Value
"`"%ProgramFiles%\Windows Defender\MSASCuiL.exe`""
} ElseIf ([System.Environment]::OSVersion.Version.Build -ge 15063) {
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\
CurrentVersion\Run" -Name "SecurityHealth" -Type ExpandString -Value "%windir%\
system32\SecurityHealthSystray.exe"
}
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows
Defender\Spynet" -Name "SpynetReporting" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows
Defender\Spynet" -Name "SubmitSamplesConsent" -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -
Name "PUAProtection" -Type DWord -Value 1
Enable-ScheduledTask -TaskName "\Microsoft\Windows\Windows Defender\Windows
Defender Cache Maintenance" | Out-Null
Enable-ScheduledTask -TaskName "\Microsoft\Windows\Windows Defender\Windows
Defender Cleanup" | Out-Null
Enable-ScheduledTask -TaskName "\Microsoft\Windows\Windows Defender\Windows
Defender Scheduled Scan" | Out-Null
Enable-ScheduledTask -TaskName "\Microsoft\Windows\Windows Defender\Windows
Defender Verification" | Out-Null
Set-MpPreference -EnableControlledFolderAccess Disabled -ErrorAction
SilentlyContinue
Clear-Host
}
'q' { }
}
}
until ($selection -match "y" -or $selection -match "n" -or $selection -match "q")
do
{
Clear-Host
Write-Host "================ Do you have High CPU Usage from Microsoft Software
Protection Platform Service? ================"
Write-ColorOutput "WARNING: Windows Default is ENABLED, if you Disabled it,
Windows 10/Office will show not activated state but you can use it as normal" Red
Write-Host "Y: Press 'Y' to Disable this."
Write-Host "N: Press 'N' to Enable this."
Write-Host "Q: Press 'Q' to stop the entire script."
$selection = Read-Host "Please make a selection"
switch ($selection)
{
'y' {
Write-Output "Disabling Microsoft Software Protection Platform Service
and related Processes..."
Disable-ScheduledTask -TaskName "\Microsoft\Windows\
SoftwareProtectionPlatform\SvcRestartTask" | Out-Null
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\sppsvc"
-Name "Start" -Type DWord -Value 4 -ErrorAction SilentlyContinue
Clear-Host
}
'n' {
Write-Output "Enabling Microsoft Software Protection Platform Service and
related Processes..."
Enable-ScheduledTask -TaskName "\Microsoft\Windows\
SoftwareProtectionPlatform\SvcRestartTask" | Out-Null
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\sppsvc"
-Name "Start" -Type DWord -Value 2 -ErrorAction SilentlyContinue
Clear-Host
}
'q' { Exit }
}
}
until ($selection -match "y" -or $selection -match "n" -or $selection -match "q")
#Ask User If He Want to Enable Or Disable Microsoft Store and WSAPPX Service
Function askMSWSAPPX {
do
{
Clear-Host
Write-Host "================ Do you want to disable Microsoft Store and Disable
WSAPPX Service? ================"
Write-ColorOutput "WARNING: Windows Default is ENABLED, if you Disabled it
and wanted to enable it again and restore Microsoft Store Please run the script
twise and choose N" Red
Write-Host "Y: Press 'Y' to Disable this."
Write-Host "N: Press 'N' to Enable this."
Write-Host "Q: Press 'Q' to stop the entire script."
$selection = Read-Host "Please make a selection"
switch ($selection)
{
'y' {
Write-Output "Disabling Microsoft Store and WSAPPX Service..."
$errpref = $ErrorActionPreference #save actual preference
$ErrorActionPreference = "silentlycontinue"
Get-AppxPackage "Microsoft.DesktopAppInstaller" | Remove-AppxPackage -
ErrorAction SilentlyContinue
Get-AppxPackage "Microsoft.WindowsStore" | Remove-AppxPackage -
ErrorAction SilentlyContinue
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\WindowsStore" -Force
| Out-Null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\WindowsStore"
-Name "DisableStoreApps" -Type DWord -Value 1 -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKLM:\SYSTEM\ControlSet001\Services\AppXSvc" -
Name "Start" -Type DWord -Value 4 -ErrorAction SilentlyContinue
$ErrorActionPreference = $errpref #restore previous preference
Clear-Host
}
'n' {
Write-Output "Enabling Microsoft Store and WSAPPX Service..."
$errpref = $ErrorActionPreference #save actual preference
$ErrorActionPreference = "silentlycontinue"
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\
WindowsStore" -Name "DisableStoreApps" -ErrorAction SilentlyContinue
Remove-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\WindowsStore" -
Force | Out-Null
Set-ItemProperty -Path "HKLM:\SYSTEM\ControlSet001\Services\AppXSvc" -
Name "Start" -Type DWord -Value 3 -ErrorAction SilentlyContinue
Get-AppxPackage -AllUsers "Microsoft.DesktopAppInstaller" | ForEach-
Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\
AppXManifest.xml"} -ErrorAction SilentlyContinue
Get-AppxPackage -AllUsers "Microsoft.WindowsStore" | ForEach-Object
{Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\
AppXManifest.xml"} -ErrorAction SilentlyContinue
$ErrorActionPreference = $errpref #restore previous preference
Clear-Host
}
'q' { Exit }
}
}
until ($selection -match "y" -or $selection -match "n" -or $selection -match "q")
# Enable Core Isolation Memory Integrity - Part of Windows Defender System Guard
virtualization-based security - Supported from 1803
Function EnableCIMemoryIntegrity {
Write-Output "Enabling Core Isolation Memory Integrity..."
If (!(Test-Path "HKLM:\SYSTEM\CurrentControlSet\Control\DeviceGuard\
Scenarios\HypervisorEnforcedCodeIntegrity")) {
New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\DeviceGuard\
Scenarios\HypervisorEnforcedCodeIntegrity" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\DeviceGuard\
Scenarios\HypervisorEnforcedCodeIntegrity" -Name "Enabled" -Type DWord -Value 1
}
##########
# Service Tweaks
##########
#Disabling Un nessessary Services For Gaming
Function DISGaming {
Write-Output "Stopping and disabling Un nessessary Services For Gaming..."
$errpref = $ErrorActionPreference #save actual preference
$ErrorActionPreference = "silentlycontinue"
Stop-Service "wisvc" -WarningAction SilentlyContinue
Set-Service "wisvc" -StartupType Disabled
Stop-Service "MapsBroker" -WarningAction SilentlyContinue
Set-Service "MapsBroker" -StartupType Disabled
Stop-Service "UmRdpService" -WarningAction SilentlyContinue
Set-Service "UmRdpService" -StartupType Disabled
Stop-Service "TrkWks" -WarningAction SilentlyContinue
Set-Service "TrkWks" -StartupType Disabled
Stop-Service "TermService" -WarningAction SilentlyContinue
Set-Service "TermService" -StartupType Disabled
Stop-Service "PcaSvc" -WarningAction SilentlyContinue
Set-Service "PcaSvc" -StartupType Disabled
$ErrorActionPreference = $errpref #restore previous preference
}
# Stop and disable Home Groups services - Not applicable to 1803 and newer or
Server
Function DisableHomeGroups {
Write-Output "Stopping and disabling Home Groups services..."
$errpref = $ErrorActionPreference #save actual preference
$ErrorActionPreference = "silentlycontinue"
Stop-Service "HomeGroupListener" -WarningAction SilentlyContinue
Set-Service "HomeGroupListener" -StartupType Disabled
Stop-Service "HomeGroupProvider" -WarningAction SilentlyContinue
Set-Service "HomeGroupProvider" -StartupType Disabled
$ErrorActionPreference = $errpref #restore previous preference
}
# Enable and start Home Groups services - Not applicable to 1803 and newer or
Server
Function EnableHomeGroups {
Write-Output "Starting and enabling Home Groups services..."
$errpref = $ErrorActionPreference #save actual preference
$ErrorActionPreference = "silentlycontinue"
Set-Service "HomeGroupListener" -StartupType Manual
Set-Service "HomeGroupProvider" -StartupType Manual
Start-Service "HomeGroupProvider" -WarningAction SilentlyContinue
$ErrorActionPreference = $errpref #restore previous preference
}
# Disable Autoplay
Function DisableAutoplay {
Write-Output "Disabling Autoplay..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\
Explorer\AutoplayHandlers" -Name "DisableAutoplay" -Type DWord -Value 1
}
# Enable Autoplay
Function EnableAutoplay {
Write-Output "Enabling Autoplay..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\
Explorer\AutoplayHandlers" -Name "DisableAutoplay" -Type DWord -Value 0
}
# Disable Hibernation
Function DisableHibernation {
Write-Output "Disabling Hibernation..."
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Session
Manager\Power" -Name "HibernteEnabled" -Type Dword -Value 0
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\
FlyoutMenuSettings")) {
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
Explorer\FlyoutMenuSettings" | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
Explorer\FlyoutMenuSettings" -Name "ShowHibernateOption" -Type Dword -Value 0
}
##########
# Windows Tweaks
##########
#Disabling power throttling.
Function PowerThrottlingOff {
Write-Output "Disabling power throttling..."
New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerThrottling"
-Force | Out-Null
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Power\
PowerThrottling" -Name "PowerThrottlingOff" -Type DWord -Value 1
}
# Show Task Manager details - Applicable to 1607 and later - Although this
functionality exist even in earlier versions, the Task Manager's behavior is
different there and is not compatible with this tweak
Function ShowTaskManagerDetails {
If ([System.Environment]::OSVersion.Version.Build -ge 22000) {
} Else {
Write-Output "Showing task manager details..."
$taskmgr = Start-Process -WindowStyle Hidden -FilePath taskmgr.exe -PassThru
Do {
Start-Sleep -Milliseconds 100
$preferences = Get-ItemProperty -Path "HKCU:\Software\Microsoft\
Windows\CurrentVersion\TaskManager" -Name "Preferences" -ErrorAction
SilentlyContinue
} Until ($preferences)
Stop-Process $taskmgr
$preferences.Preferences[28] = 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\
TaskManager" -Name "Preferences" -Type Binary -Value $preferences.Preferences
}
}
# Set taskbar buttons to show labels and combine when taskbar is full
Function SetTaskbarCombineWhenFull {
Write-Output "Setting taskbar buttons to combine when taskbar is full..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\
Explorer\Advanced" -Name "TaskbarGlomLevel" -Type DWord -Value 1
}
##########
# Explorer UI Tweaks
##########
# Hide Desktop icon from This PC - The icon remains in personal folders and
open/save dialogs
Function HideDesktopFromThisPC {
Write-Output "Hiding Desktop icon from This PC..."
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\
MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}" -Recurse -ErrorAction
SilentlyContinue
}
# Hide Desktop icon from Explorer namespace - Hides the icon also from personal
folders and open/save dialogs
Function HideDesktopFromExplorer {
Write-Output "Hiding Desktop icon from Explorer namespace..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag" -
Name "ThisPCPolicy" -Type String -Value "Hide"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\
CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\
PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
}
# Hide Documents icon from This PC - The icon remains in personal folders and
open/save dialogs
Function HideDocumentsFromThisPC {
Write-Output "Hiding Documents icon from This PC..."
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\
MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}" -Recurse -ErrorAction
SilentlyContinue
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\
MyComputer\NameSpace\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}" -Recurse -ErrorAction
SilentlyContinue
}
# Hide Documents icon from Explorer namespace - Hides the icon also from personal
folders and open/save dialogs
Function HideDocumentsFromExplorer {
Write-Output "Hiding Documents icon from Explorer namespace..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag" -
Name "ThisPCPolicy" -Type String -Value "Hide"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\
CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\
PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
}
# Hide Downloads icon from This PC - The icon remains in personal folders and
open/save dialogs
Function HideDownloadsFromThisPC {
Write-Output "Hiding Downloads icon from This PC..."
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\
MyComputer\NameSpace\{088e3905-0323-4b02-9826-5d99428e115f}" -Recurse -ErrorAction
SilentlyContinue
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\
MyComputer\NameSpace\{374DE290-123F-4565-9164-39C4925E467B}" -Recurse -ErrorAction
SilentlyContinue
}
# Hide Downloads icon from Explorer namespace - Hides the icon also from personal
folders and open/save dialogs
Function HideDownloadsFromExplorer {
Write-Output "Hiding Downloads icon from Explorer namespace..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag" -
Name "ThisPCPolicy" -Type String -Value "Hide"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\
CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\
PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
}
# Hide Music icon from This PC - The icon remains in personal folders and open/save
dialogs
Function HideMusicFromThisPC {
Write-Output "Hiding Music icon from This PC..."
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\
MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}" -Recurse -ErrorAction
SilentlyContinue
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\
MyComputer\NameSpace\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}" -Recurse -ErrorAction
SilentlyContinue
}
# Hide Music icon from Explorer namespace - Hides the icon also from personal
folders and open/save dialogs
Function HideMusicFromExplorer {
Write-Output "Hiding Music icon from Explorer namespace..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag" -
Name "ThisPCPolicy" -Type String -Value "Hide"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\
CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\
PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
}
# Hide Pictures icon from This PC - The icon remains in personal folders and
open/save dialogs
Function HidePicturesFromThisPC {
Write-Output "Hiding Pictures icon from This PC..."
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\
MyComputer\NameSpace\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}" -Recurse -ErrorAction
SilentlyContinue
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\
MyComputer\NameSpace\{3ADD1653-EB32-4cb0-BBD7-DFA0ABB5ACCA}" -Recurse -ErrorAction
SilentlyContinue
}
# Hide Pictures icon from Explorer namespace - Hides the icon also from personal
folders and open/save dialogs
Function HidePicturesFromExplorer {
Write-Output "Hiding Pictures icon from Explorer namespace..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag" -
Name "ThisPCPolicy" -Type String -Value "Hide"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\
CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\
PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
}
# Hide Videos icon from This PC - The icon remains in personal folders and
open/save dialogs
Function HideVideosFromThisPC {
Write-Output "Hiding Videos icon from This PC..."
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\
MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}" -Recurse -ErrorAction
SilentlyContinue
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\
MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}" -Recurse -ErrorAction
SilentlyContinue
}
# Hide Videos icon from Explorer namespace - Hides the icon also from personal
folders and open/save dialogs
Function HideVideosFromExplorer {
Write-Output "Hiding Videos icon from Explorer namespace..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag" -
Name "ThisPCPolicy" -Type String -Value "Hide"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\
CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\
PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
}
# Hide 3D Objects icon from This PC - The icon remains in personal folders and
open/save dialogs
Function Hide3DObjectsFromThisPC {
Write-Output "Hiding 3D Objects icon from This PC..."
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\
MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" -Recurse -ErrorAction
SilentlyContinue
}
# Hide 3D Objects icon from Explorer namespace - Hides the icon also from personal
folders and open/save dialogs
Function Hide3DObjectsFromExplorer {
Write-Output "Hiding 3D Objects icon from Explorer namespace..."
$errpref = $ErrorActionPreference #save actual preference
$ErrorActionPreference = "silentlycontinue"
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\
FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag")) {
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -
Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -
Name "ThisPCPolicy" -Type String -Value "Hide"
If (!(Test-Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\
Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag")) {
New-Item -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\
CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\
PropertyBag" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\
CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\
PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
$ErrorActionPreference = $errpref #restore previous preference
}
# Enable thumbnails
Function EnableThumbnails {
Write-Output "Enabling thumbnails..."
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\
Explorer\Advanced" -Name "IconsOnly" -Type DWord -Value 0
}
##########
# Application Tweaks
##########
# Option To Uninstall Or install OneDrive
Function DorEOneDrive {
do
{
Clear-Host
Write-Host "================ Do you want to Disable Microsoft OneDrive?
================"
Write-Host "Y: Press 'Y' to Disable OneDrive."
Write-Host "N: Press 'N' to Enable OneDrive."
Write-Host "Q: Press 'Q' to Skip this."
$selection = Read-Host "Please make a selection"
switch ($selection)
{
'y' {
Write-Output "Disabling Microsoft OneDrive and related Processes..."
# Disable OneDrive
$errpref = $ErrorActionPreference #save actual preference
$ErrorActionPreference = "silentlycontinue"
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" |
Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -
Name "DisableFileSyncNGSC" -Type DWord -Value 1 -ErrorAction SilentlyContinue
# Uninstall OneDrive - Not applicable to Server
Stop-Process -Name "OneDrive" -ErrorAction SilentlyContinue
Start-Sleep -s 2
$onedrive = "$env:SYSTEMROOT\SysWOW64\OneDriveSetup.exe"
If (!(Test-Path $onedrive)) {
$onedrive = "$env:SYSTEMROOT\System32\OneDriveSetup.exe"
}
Start-Process $onedrive "/uninstall" -NoNewWindow -Wait
Start-Sleep -s 2
Stop-Process -Name "explorer" -ErrorAction SilentlyContinue
Start-Sleep -s 2
Remove-Item -Path "$env:USERPROFILE\OneDrive" -Force -Recurse -ErrorAction
SilentlyContinue
Remove-Item -Path "$env:LOCALAPPDATA\Microsoft\OneDrive" -Force -Recurse -
ErrorAction SilentlyContinue
Remove-Item -Path "$env:PROGRAMDATA\Microsoft OneDrive" -Force -Recurse -
ErrorAction SilentlyContinue
Remove-Item -Path "$env:SYSTEMDRIVE\OneDriveTemp" -Force -Recurse -
ErrorAction SilentlyContinue
If (!(Test-Path "HKCR:")) {
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT |
Out-Null
}
Remove-Item -Path "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -
Recurse -ErrorAction SilentlyContinue
Remove-Item -Path "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-
224DE2ED1FE6}" -Recurse -ErrorAction SilentlyContinue
reg load "hku\Default" "C:\Users\Default\NTUSER.DAT"
reg delete "HKEY_USERS\Default\SOFTWARE\Microsoft\Windows\CurrentVersion\
Run" /v "OneDriveSetup" /f
reg unload "hku\Default"
Remove-Item -Force -ErrorAction SilentlyContinue "$env:userprofile\AppData\
Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk"
Get-ScheduledTask -TaskPath '\' -TaskName 'OneDrive*' -ea SilentlyContinue |
Unregister-ScheduledTask -Confirm:$false
$ErrorActionPreference = $errpref #restore previous preference
Clear-Host
}
'n' {
Write-Output "Enabling Microsoft OneDrive and related Processes..."
# Enable OneDrive
$errpref = $ErrorActionPreference #save actual preference
$ErrorActionPreference = "silentlycontinue"
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
OneDrive" -Name "DisableFileSyncNGSC" -ErrorAction SilentlyContinue
# Set Photo Viewer association for bmp, gif, jpg, png and tif
Function SetPhotoViewerAssociation {
Write-Output "Setting Photo Viewer association for bmp, gif, jpg, png and
tif..."
If (!(Test-Path "HKCR:")) {
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT |
Out-Null
}
ForEach ($type in @("Paint.Picture", "giffile", "jpegfile", "pngfile")) {
New-Item -Path $("HKCR:\$type\shell\open") -Force | Out-Null
New-Item -Path $("HKCR:\$type\shell\open\command") | Out-Null
Set-ItemProperty -Path $("HKCR:\$type\shell\open") -Name "MuiVerb" -
Type ExpandString -Value "@%ProgramFiles%\Windows Photo Viewer\photoviewer.dll,-
3043"
Set-ItemProperty -Path $("HKCR:\$type\shell\open\command") -Name
"(Default)" -Type ExpandString -Value "%SystemRoot%\System32\rundll32.exe
`"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1"
}
}
# Unset Photo Viewer association for bmp, gif, jpg, png and tif
Function UnsetPhotoViewerAssociation {
Write-Output "Unsetting Photo Viewer association for bmp, gif, jpg, png and
tif..."
If (!(Test-Path "HKCR:")) {
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT |
Out-Null
}
Remove-Item -Path "HKCR:\Paint.Picture\shell\open" -Recurse -ErrorAction
SilentlyContinue
Remove-ItemProperty -Path "HKCR:\giffile\shell\open" -Name "MuiVerb" -
ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCR:\giffile\shell\open" -Name "CommandId" -Type
String -Value "IE.File"
Set-ItemProperty -Path "HKCR:\giffile\shell\open\command" -Name "(Default)" -
Type String -Value "`"$env:SystemDrive\Program Files\Internet Explorer\
iexplore.exe`" %1"
Set-ItemProperty -Path "HKCR:\giffile\shell\open\command" -Name
"DelegateExecute" -Type String -Value "{17FE9752-0B5A-4665-84CD-569794602F5C}"
Remove-Item -Path "HKCR:\jpegfile\shell\open" -Recurse -ErrorAction
SilentlyContinue
Remove-Item -Path "HKCR:\pngfile\shell\open" -Recurse -ErrorAction
SilentlyContinue
}
##########
# Unpinning
##########
# Unpin all Start Menu tiles - Note: This function has no counterpart. You have to
pin the tiles back manually.
Function UnpinStartMenuTiles {
Write-Output "Unpinning all Start Menu tiles..."
$errpref = $ErrorActionPreference #save actual preference
$ErrorActionPreference = "silentlycontinue"
If ([System.Environment]::OSVersion.Version.Build -ge 22000) {
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\
CurrentVersion\Policies\Explorer" -Name "NoRecentDocsHistory" -Type DWord -Value 0
| Out-Null -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\
CurrentVersion\Explorer\Advanced" -Name "Start_TrackDocs" -Type DWord -Value 0 |
Out-Null -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\
CurrentVersion\Policies\Explorer" -Name "NoStartMenuMorePrograms" | Out-Null -
ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\
CurrentVersion\Policies\Explorer" -Name "NoStartMenuMorePrograms" | Out-Null -
ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
Explorer" -Name "LockedStartLayout" | Out-Null -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
Explorer" -Name "StartLayoutFile" | Out-Null -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\
Explorer" -Name "LockedStartLayout" | Out-Null -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\
Explorer" -Name "StartLayoutFile" | Out-Null -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\
CurrentVersion\Explorer\Advanced" -Name "Start_Layout" -Type DWord -Value 1 | Out-
Null -ErrorAction SilentlyContinue
} Else {
Invoke-WebRequest -Uri "https://git.io/JL54C" -OutFile "$env:UserProfile\
StartLayout.xml" -ErrorAction SilentlyContinue
Import-StartLayout -layoutpath "$env:UserProfile\StartLayout.xml" -MountPath
"$env:SystemDrive\"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer" -
Name "LockedStartLayout" -Type DWord -Value 1 | Out-Null -ErrorAction
SilentlyContinue
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer" -
Name "StartLayoutFile" -Type ExpandString -Value "%USERPROFILE%\StartLayout.xml" |
Out-Null -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\
Policies\Explorer" -Name "NoStartMenuMorePrograms" -Type DWord -Value 0 | Out-Null
-ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
Policies\Explorer" -Name "NoStartMenuMorePrograms" -Type DWord -Value 0 | Out-Null
-ErrorAction SilentlyContinue
Start-Sleep -s 3
$wshell = New-Object -ComObject wscript.shell;
$wshell.SendKeys('^{ESCAPE}')
Start-Sleep -s 3
function get-itemproperty2 {
# get-childitem skips top level key, use get-item for that
# set-alias gp2 get-itemproperty2
param([parameter(ValueFromPipeline)]$key)
process {
$key.getvaluenames() | foreach-object {
$value = $_
[pscustomobject] @{
Path = $Key -replace 'HKEY_CURRENT_USER',
'HKCU:' -replace 'HKEY_LOCAL_MACHINE','HKLM:'
Name = $Value
Value = $Key.GetValue($Value)
Type = $Key.GetValueKind($Value)
}
}
}
}
}
$YourInputStart =
"02,00,00,00,e6,d9,21,ac,f8,e0,d6,01,00,00,00,00,43,42,01,00,c2,14,01,cb,32,0a,03,0
5,ce,ab,d3,e9,02,24,da,f4,03,44,c3,8a,01,66,82,e5,8b,b1,ae,fd,fd,bb,3c,00,05,a0,8f,
fc,c1,03,24,8a,d0,03,44,80,99,01,66,b0,b5,99,dc,cd,b0,97,de,4d,00,05,86,91,cc,93,05
,24,aa,a3,01,44,c3,84,01,66,9f,f7,9d,b1,87,cb,d1,ac,d4,01,00,c2,3c,01,c5,5a,01,00"
$hexifiedStart = $YourInputStart.Split(',') | ForEach-Object { "0x$_"}
Get-ChildItem -r "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CloudStore\Store\
Cache\DefaultAccount\" | get-itemproperty2 | Where-Object { $_ -like
'*windows.data.unifiedtile.startglobalproperties*' } | set-itemproperty -value
(([byte[]]$hexifiedStart))
Stop-Process -name explorer | Out-Null
$ErrorActionPreference = $errpref #restore previous preference
}
##########
# DaddyMadu Quality Of Life Tweaks
##########
# Windows 11 Extra Tweaks
function Windows11Extra {
If ([System.Environment]::OSVersion.Version.Build -ge 22000) {
Write-Output "Restoring windows 10 context menu and disabling start
menu recommended section..."
New-Item -Path "HKCU:\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-
50c905bae2a2}\InprocServer32" -ErrorAction SilentlyContinue | Out-Null #context
menu setup
reg add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-
50c905bae2a2}\InprocServer32" /f /ve
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\
CurrentVersion\Explorer\Advanced" -Name "TaskbarAl" -Type DWord -Value 0 #set
taskbar icons to the left
Get-appxpackage -all *shellexperience* -packagetype bundle |ForEach-
Object {add-appxpackage -register -disabledevelopmentmode ($_.installlocation + '\
appxmetadata\appxbundlemanifest.xml')}
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\
CurrentVersion\Explorer\Advanced" -Name "TaskbarDa" -Type DWord -Value 0 #disable
widget icon from taskbar
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\
CurrentVersion\Explorer\Advanced" -Name "TaskbarMn" -Type DWord -Value 0 #disable
chat icon from taskbar
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
Explorer" -Name "HideRecentlyAddedApps" -Type DWord -Value 1 #Disable start menu
RecentlyAddedApps
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session
Manager\kernel" -Name "ThreadDpcEnable" -Type DWord -Value 0 | Out-Null -
ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\
Session Manager\kernel" -Name "GlobalTimerResolutionRequests" -Type DWord -Value 1
| Out-Null -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session
Manager\kernel" -Name "UnlimitDpcQueue" -Type DWord -Value 1 | Out-Null -
ErrorAction SilentlyContinue
}
}
# Enable Quality Of Life Tweaks
Function QOL {
Write-Output "Enabling DaddyMadu Quality of Life Tweaks..."
$errpref = $ErrorActionPreference #save actual preference
$ErrorActionPreference = "silentlycontinue"
New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\
UserProfileEngagement" -ErrorAction SilentlyContinue | Out-Null
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\
UserProfileEngagement" -Name "ScoobeSystemSettingEnabled" -Type DWord -Value 0 |
Out-Null -ErrorAction SilentlyContinue #disable annoying Get even more out of
Windows
Set-ItemProperty -Path "HKCU:\Control Panel\Accessibility" -Name
"DynamicScrollbars" -Type DWord -Value 0 #disable Hide Scroll bars
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "SmoothScroll" -
Type DWord -Value 0 #disable smooth scrolling
If ([System.Environment]::OSVersion.Version.Build -ge 22000) {
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
Policies\Explorer" -Name "NoInstrumentation" -Type DWord -Value 1 #disable
microsoft usertracking
} Else {
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\
Policies\Explorer" -Name "NoInstrumentation" -Type DWord -Value 1 #disable
microsoft usertracking
}
Remove-ItemProperty -Path "HKCU:\Software\Policies\Microsoft\Windows\
Explorer" -Name "TaskbarNoMultimon" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\
Explorer" -Name "TaskbarNoMultimon" -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\
Explorer\Advanced" -Name "MMTaskbarMode" -Type DWord -Value 2 #Show taskbar buttons
only on taskbar where window is open
$ErrorActionPreference = $errpref #restore previous preference
}
##########
# Gaming Tweaks Functions
##########
#Detecting Windows Scale Layout Automatically and applying mouse fix according to
it!
Function DetectnApplyMouseFIX {
Add-Type @'
using System;
using System.Runtime.InteropServices;
using System.Drawing;
#Optimizing Network and applying Tweaks for no throttle and maximum speed!
Function NetworkOptimizations {
Write-Output "Optimizing Network and applying Tweaks for no throttle and
maximum speed!..."
$errpref = $ErrorActionPreference #save actual preference
$ErrorActionPreference = "silentlycontinue"
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Psched" -
ErrorAction SilentlyContinue | Out-Null
New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\QoS" -
ErrorAction SilentlyContinue | Out-Null
New-Item -Path "HKLM:\SOFTWARE\Microsoft\MSMQ\Parameters" -ErrorAction
SilentlyContinue | Out-Null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Internet Explorer\MAIN\
FeatureControl\FEATURE_MAXCONNECTIONSPER1_0SERVER" -Name "explorer.exe" -Type DWord
-Value 10
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Internet Explorer\MAIN\
FeatureControl\FEATURE_MAXCONNECTIONSPERSERVER" -Name "explorer.exe" -Type DWord -
Value 10
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\
ServiceProvider" -Name "LocalPriority" -Type DWord -Value 4
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\
ServiceProvider" -Name "HostsPriority" -Type DWord -Value 5
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\
ServiceProvider" -Name "DnsPriority" -Type DWord -Value 6
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\
ServiceProvider" -Name "NetbtPriority" -Type DWord -Value 7
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Psched" -
Name "NonBestEffortlimit" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\QoS" -
Name "Do not use NLA" -Type String -Value "1"
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\
LanmanServer\Parameters" -Name "Size" -Type DWord -Value 1
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\
LanmanServer\Parameters" -Name "IRPStackSize" -Type DWord -Value 20
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\
Parameters" -Name "MaxUserPort" -Type DWord -Value 65534
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\
Parameters" -Name "TcpTimedWaitDelay" -Type DWord -Value 30
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\
Parameters" -Name "DefaultTTL" -Type DWord -Value 64
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\MSMQ\Parameters" -Name
"TCPNoDelay" -Type DWord -Value 1
Set-ItemProperty -Path "HKLM:\SYSTEM\ControlSet001\Control\Lsa" -Name
"LmCompatibilityLevel" -Type DWord -Value 1
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\
Parameters" -Name "EnableAutoDoh" -Type DWord -Value 2
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\
Parameters" -Name "MaxNumRssCpus" -Type DWord -Value 4
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\
Parameters" -Name "DisableTaskOffload" -Type DWord -Value 0
Set-NetTCPSetting -SettingName internet -EcnCapability disabled | Out-Null
Set-NetOffloadGlobalSetting -Chimney disabled | Out-Null
Set-NetTCPSetting -SettingName internet -Timestamps disabled | Out-Null
Set-NetTCPSetting -SettingName internet -MaxSynRetransmissions 2 | Out-Null
Set-NetTCPSetting -SettingName internet -NonSackRttResiliency disabled |
Out-Null
Set-NetTCPSetting -SettingName internet -InitialRto 2000 | Out-Null
Set-NetTCPSetting -SettingName internet -MinRto 300 | Out-Null
Set-NetTCPSetting -SettingName Internet -AutoTuningLevelLocal normal | Out-
Null
Set-NetTCPSetting -SettingName internet -ScalingHeuristics disabled | Out-
Null
netsh int tcp set supplemental internet congestionprovider=ctcp | Out-Null
netsh int tcp set global rss=enabled | Out-Null
netsh int ip set global taskoffload=enabled | Out-Null
Set-NetOffloadGlobalSetting -ReceiveSegmentCoalescing disabled | Out-Null
Set-NetOffloadGlobalSetting -ReceiveSideScaling enabled | Out-Null
Disable-NetAdapterLso -Name * | Out-Null
Enable-NetAdapterChecksumOffload -Name * | Out-Null
Set-NetAdapterAdvancedProperty -Name * -DisplayName "Energy-Efficient
Ethernet" -DisplayValue "Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "Energy Efficient
Ethernet" -DisplayValue "Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "Energy Efficient
Ethernet" -DisplayValue "Off" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "Ultra Low Power Mode" -
DisplayValue "Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "System Idle Power
Saver" -DisplayValue "Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "Green Ethernet" -
DisplayValue "Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "Power Saving Mode" -
DisplayValue "Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "Gigabit Lite" -
DisplayValue "Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "EEE" -DisplayValue
"Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "Advanced EEE" -
DisplayValue "Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "ARP Offload" -
DisplayValue "Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "NS Offload" -
DisplayValue "Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "Large Send Offload v2
(IPv4)" -DisplayValue "Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "Large Send Offload v2
(IPv6)" -DisplayValue "Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "TCP Checksum Offload
(IPv4)" -DisplayValue "Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "TCP Checksum Offload
(IPv6)" -DisplayValue "Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "UDP Checksum Offload
(IPv4)" -DisplayValue "Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "UDP Checksum Offload
(IPv6)" -DisplayValue "Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "Idle Power Saving" -
DisplayValue "Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "Flow Control" -
DisplayValue "Enabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "Flow Control" -
DisplayValue "Rx & Tx Enabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "Interrupt Moderation" -
DisplayValue "Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "Reduce Speed On Power
Down" -DisplayValue "Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "Interrupt Moderation
Rate" -DisplayValue "Off" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "Log Link State Event" -
DisplayValue "Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "Packet Priority & VLAN"
-DisplayValue "Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "Packet Priority & VLAN"
-DisplayValue "Packet Priority & VLAN Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "Priority & VLAN" -
DisplayValue "Priority & VLAN Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "IPv4 Checksum Offload"
-DisplayValue "Rx & Tx Enabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "Jumbo Frame" -
DisplayValue "Disabled" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "Maximum Number of RSS
Queues" -DisplayValue "2 Queues" -ErrorAction SilentlyContinue
Set-NetAdapterAdvancedProperty -Name * -DisplayName "Receive Side Scaling" -
DisplayValue "Enabled" -ErrorAction SilentlyContinue
$ErrorActionPreference = $errpref #restore previous preference
if ((Get-CimInstance -ClassName Win32_ComputerSystem).PCSystemType -ne 2)
{
$adapters = Get-NetAdapter -Physical | Get-NetAdapterPowerManagement | Where-
Object -FilterScript {$_.AllowComputerToTurnOffDevice -ne "Unsupported"}
foreach ($adapter in $adapters)
{
$adapter.AllowComputerToTurnOffDevice = "Disabled"
$adapter | Set-NetAdapterPowerManagement
}
}
Start-Sleep -s 5
}
Foreach($PhysicalAdapter in $PhysicalAdapters)
{
# $PhysicalAdapterName = $PhysicalAdapter.Name
$DeviceID = $PhysicalAdapter.DeviceID
If([Int32]$DeviceID -lt 10)
{
$AdapterDeviceNumber = "000"+$DeviceID
}
Else
{
$AdapterDeviceNumber = "00"+$DeviceID
}
$KeyPath = "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-
E325-11CE-BFC1-08002bE10318}\$AdapterDeviceNumber"
$KeyPath2 = "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-
E325-11CE-BFC1-08002bE10318}\$AdapterDeviceNumber\Ndi\params\*RSS\Enum"
$KeyPath3 = "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-
E325-11CE-BFC1-08002bE10318}\$AdapterDeviceNumber\Ndi\params\*RSS"
$KeyPath4 = "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-
E325-11CE-BFC1-08002bE10318}\$AdapterDeviceNumber\Ndi\params\*NumRssQueues\Enum"
$KeyPath5 = "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-
E325-11CE-BFC1-08002bE10318}\$AdapterDeviceNumber\Ndi\params\*NumRssQueues"
$KeyPath6 = "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-
E325-11CE-BFC1-08002bE10318}\$AdapterDeviceNumber\Ndi\params\*ReceiveBuffers"
$KeyPath7 = "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-
E325-11CE-BFC1-08002bE10318}\$AdapterDeviceNumber\Ndi\params\*TransmitBuffers"
#fix issue with games shortcut that created by games lunchers turned white!
Function FixURLext {
Write-Host "Fixing White Games Shortcuts created by game launchers...."
choco install -y setuserfta | Out-Null
Start-Sleep -s 5
Push-Location
set-location "$env:ProgramData\chocolatey\lib\setuserfta\tools\SetUserFTA\"
SetUserFTA.exe del .url | Out-Null
SetUserFTA.exe .url, InternetShortcut | Out-Null
Pop-Location
choco uninstall -y setuserfta | Out-Null
}
#DaddyMadu Ultimate CLeaner
Function UltimateCleaner {
Write-Host "Running DaddyMadu Ultimate Cleaner => Temp folders & Flush DNS +
Reset IP...."
cmd /c 'netsh winsock reset 2>nul' >$null
cmd /c 'netsh int ip reset 2>nul' >$null
cmd /c 'ipconfig /release 2>nul' >$null
cmd /c 'ipconfig /renew 2>nul' >$null
cmd /c 'ipconfig /flushdns 2>nul' >$null
cmd /c 'echo Flush DNS + IP Reset Completed Successfully!'
cmd /c 'echo Clearing Temp folders....'
cmd /c 'del /f /s /q %systemdrive%\*.tmp 2>nul' >$null
cmd /c 'del /f /s /q %systemdrive%\*._mp 2>nul' >$null
cmd /c 'del /f /s /q %systemdrive%\*.log 2>nul' >$null
cmd /c 'del /f /s /q %systemdrive%\*.gid 2>nul' >$null
cmd /c 'del /f /s /q %systemdrive%\*.chk 2>nul' >$null
cmd /c 'del /f /s /q %systemdrive%\*.old 2>nul' >$null
cmd /c 'del /f /s /q %systemdrive%\recycled\*.* 2>nul' >$null
cmd /c 'del /f /s /q %windir%\*.bak 2>nul' >$null
cmd /c 'del /f /s /q %windir%\prefetch\*.* 2>nul' >$null
cmd /c 'del /f /q %userprofile%\cookies\*.* 2>nul' >$null
cmd /c 'del /f /q %userprofile%\recent\*.* 2>nul' >$null
cmd /c 'del /f /s /q %userprofile%\Local Settings\Temporary Internet Files\*.*
2>nul' >$null
$errpref = $ErrorActionPreference #save actual preference
$ErrorActionPreference = "silentlycontinue"
Get-ChildItem -Path "$env:temp" -Exclude "dmtmp" | ForEach-Object ($_) {
"CLEANING :" + $_.fullname
Remove-Item $_.fullname -Force -Recurse
"CLEANED... :" + $_.fullname
}
$ErrorActionPreference = $errpref #restore previous preference
cmd /c 'del /f /s /q %userprofile%\recent\*.* 2>nul' >$null
cmd /c 'del /f /s /q %windir%\Temp\*.* 2>nul' >$null
cmd /c 'echo Temp folders Cleared Successfully!'
}
# Restart computer
Function Restart {
Write-Output "Restarting..."
Restart-Computer
}
###########
# Titus Additions
###########
Function EnableDarkMode {
Write-Output "Enabling Dark Mode"
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\
Themes\Personalize -Name AppsUseLightTheme -Value 0
}
Function DisableDarkMode {
Write-Output "Disabling Dark Mode"
Remove-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\
Themes\Personalize -Name AppsUseLightTheme
}
##########
# Debloat Script Additions
##########
Function Stop-EdgePDF {
# get the software classes for the file and URL types that Edge will associate
$FileTypes = Get-Item $FileAssocKey
$URLTypes = Get-Item $URLAssocKey
$Associations = @()
$Filetypes.Property | ForEach-Object {$Associations += $FileAssoc.$_}
$URLTypes.Property | ForEach-Object {$Associations += $URLAssoc.$_}
# add registry values in each software class to stop edge from associating as the
default
foreach ($Association in $Associations)
{
$Class = Join-Path HKCU:SOFTWARE\Classes $Association
#if (Test-Path $class)
# {write-host $Association}
# Get-Item $Class
Set-ItemProperty $Class -Name NoOpenWith -Value ""
Set-ItemProperty $Class -Name NoStaticDefaultVerb -Value ""
}
}
# In case you have removed them for good, you can try to restore the files using
installation medium as follows
# New-Item C:\Mnt -Type Directory | Out-Null
# dism /Mount-Image /ImageFile:D:\sources\install.wim /index:1 /ReadOnly
/MountDir:C:\Mnt
# robocopy /S /SEC /R:0 "C:\Mnt\Program Files\WindowsApps" "C:\Program Files\
WindowsApps"
# dism /Unmount-Image /Discard /MountDir:C:\Mnt
# Remove-Item -Path C:\Mnt -Recurse
Function DebloatAll {
Clear-Host
$Bloatware = @(
#Unnecessary Windows 10 AppX Apps
"*3DBuilder*"
"*AppConnector*"
"*BingFinance*"
"*BingNews*"
"*BingSports*"
"*BingTranslator*"
"*BingWeather*"
"*GetHelp*"
"*Getstarted*"
"*Messaging*"
"*Microsoft3DViewer*"
"*MicrosoftSolitaireCollection*"
"*MicrosoftPowerBIForWindows*"
"*MicrosoftStickyNotes*"
"*NetworkSpeedTest*"
"*OneNote*"
"*Lens*"
"*Sway*"
"*OneConnect*"
"*People*"
"*Print3D*"
"*RemoteDesktop*"
"*SkypeApp*"
"*Wallet*"
"*Whiteboard*"
"*WindowsAlarms*"
"*WindowsFeedbackHub*"
"*WindowsMaps*"
"*WindowsSoundRecorder*"
"*MicrosoftOfficeHub*"
"*MixedReality.Portal*"
"*ScreenSketch*"
"*MicrosoftOfficeHub*"
"*Microsoft.MSPaint*"
"Microsoft.549981C3F5F10"
"*Advertising.Xaml*"
"*SolitaireCollection*"
"*EclipseManager*"
"*ActiproSoftwareLLC*"
"*AdobePhotoshopExpress*"
"*Duolingo-LearnLanguagesforFree*"
"*PandoraMediaInc*"
"*CandyCrush*"
"*BubbleWitch3Saga*"
"*Wunderlist*"
"*Flipboard*"
"*Twitter*"
"*Facebook*"
"*Royal Revolt*"
"*Sway*"
"*Speed Test*"
"*Viber*"
"*ACGMediaPlayer*"
"*Netflix*"
"*OneCalendar*"
"*LinkedInforWindows*"
"*HiddenCityMysteryofShadows*"
"*Hulu*"
"*HiddenCity*"
"*AdobePhotoshopExpress*"
"*RoyalRevolt2*"
"*AutodeskSketchBook*"
"*DisneyMagicKingdoms*"
"*MarchofEmpires*"
"*Plex*"
"*FarmVille2CountryEscape*"
"*CyberLinkMediaSuiteEssentials*"
"*DrawboardPDF*"
"*Asphalt8Airborne*"
"*Keeper*"
"*SpotifyMusic*"
"*WinZipUniversal*"
"*XING*"
"*Advertising.Xaml*"
"*Advertising.Xaml*"
"*Roblox*"
)
foreach ($Bloat in $Bloatware) {
$errpref = $ErrorActionPreference #save actual preference
$ErrorActionPreference = "silentlycontinue"
Get-AppxPackage -AllUsers -Name $Bloat| Remove-AppxPackage | Out-Null -
ErrorAction SilentlyContinue
Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $Bloat
| Remove-AppxProvisionedPackage -Online | Out-Null -ErrorAction SilentlyContinue
$ErrorActionPreference = $errpref #restore previous preference
Write-Output "Trying to remove $Bloat."
}
}
##########
# Parse parameters and apply tweaks
##########