Table of Contents
We continue with the powershell processes to optimize and accelerate Windows 10/11. You must run powershell as administrator before running all these commands. These proccess work perfectly fine on windows 10. It may give some errors in windows 11. Previous articles can be found here.
Diagnostics and Feedback
The Connected User Experiences and Telemetry, originally called Diagnostics Tracking or DiagTracK is a Windows service that runs automatically and sends data to Microsoft.
Disable Diagnostics
#Write-Host "Diagnostics Tracking Service Disabling..."
Stop-Service "DiagTrack"
Set-Service "DiagTrack" -StartupType Disabled
Enabling Diagnostics
#Write-Host "Diagnostics Tracking Service Etkinlestiriliyor..."
Set-Service "DiagTrack" -StartupType Automatic
Start-Service "DiagTrack"
WAP Push Service
Disabling WAP Push Service
#Write-Host "WAP Push Service Disabling..."
Stop-Service "dmwappushservice"
Set-Service "dmwappushservice" -StartupType Disabled
Enabling WAP Push Service
#Write-Host "WAP Push Service Enabling..."
Set-Service "dmwappushservice" -StartupType Automatic
Start-Service "dmwappushservice"
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\dmwappushservice" -Name "DelayedAutoStart" -Type DWord -Value 1
UAC (User Account Control)
User Account Control (UAC) helps prevent malware from damaging a PC and helps organizations deploy a better-managed desktop. With UAC, apps and tasks always run in the security context of a non-administrator account, unless an administrator specifically authorizes administrator-level access to the system. UAC can block the automatic installation of unauthorized apps and prevent inadvertent changes to system settings.
Decrease UAC – Set 0
# Write-Host "UAC Decrease..."
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "PromptOnSecureDesktop" -Type DWord -Value 0
Increase UAC Set 5
#Write-Host "UAC set 5..."
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Type DWord -Value 5
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "PromptOnSecureDesktop" -Type DWord -Value 1
Windows Firewall
Windows Firewall is a Microsoft Windows application that filters information coming to your system from the Internet and blocking potentially harmful programs. The software blocks most programs from communicating through the firewall. Users simply add a program to the list of allowed programs to allow it to communicate through the firewall. When using a public network, Windows Firewall can also secure the system by blocking all unsolicited attempts to connect to your computer.
Disable Firewall
Note: Disabling Windows Firewall is not recommended.
#Disable
Write-Host "Firewall Disabling..."
Set-NetFirewallProfile -Profile * -Enabled False
Enabling Firewall
#Write-Host "Firewall Enabling..."
Set-NetFirewallProfile -Profile * -Enabled True
Windows Defender for Security
Microsoft Defender is a component of Microsoft Windows 10 to delivers comprehensive, built-in and ongoing security protections. Its’ component includes anti-virus, anti-malware, firewall and more, to keep your personal computer safe.
You may learn more about Windows Defender from Microsoft website.
Disabling Windows Defender
# Disable
# Write-Host "Windows Defender Disable..."
Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows Defender" -Name "DisableAntiSpyware" -Type DWord -Value 1
Enable Defender
#Write-Host "Windows Defender Enabling..."
Remove-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows Defender" -Name "DisableAntiSpyware"
Disable Auto Reboot After Update
After an update is installed, Windows attempts automatic restart outside of active hours. If the restart does not succeed after seven days (by default), the user will see a notification that restart is required. You can use the Specify deadline before auto-restart for update installation policy to change the delay from seven days to any number of days between two and 14. With Windows 11 we can extend this period up to 5 weeks.
Still, sometimes it’s not enough. We don’t want our computer to restart unless we want it to. There are many reasons for this. Lost data, work, etc. as a result of a sudden restart.
Disable Auto Reboot with Powershell
Write-Host "Disable Windows Auto Update Reboot..."
Set-ItemProperty -Path "HKLM:\Software\Microsoft\WindowsUpdate\UX\Settings" -Name "UxOption" -Type DWord -Value 1
Enable Auto Reboot with Powershell
Write-Host "Disabling Reboot after Update..."
Set-ItemProperty -Path "HKLM:\Software\Microsoft\WindowsUpdate\UX\Settings" -Name "UxOption" -Type DWord -Value 0