Skip to content

Instantly share code, notes, and snippets.

@Fleshgrinder
Last active August 23, 2020 06:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fleshgrinder/13806f13cfe02d64265cabe9f55ea3f5 to your computer and use it in GitHub Desktop.
Save Fleshgrinder/13806f13cfe02d64265cabe9f55ea3f5 to your computer and use it in GitHub Desktop.
A few commands I routinely execute after setting up a new Windows machine to speed thing up a little and disable annoying stuff.
function dword {
Param([string] $path, [string] $name, [string] $value)
if (!(Test-Path $path)) {
New-Item -Path (Split-Path $path) -Name (Split-Path $path -leaf) | Out-Null
}
New-ItemProperty -Path $path -Name $name -Value $value -PropertyType DWORD -Force | Out-Null
}
# disables the creation of so called 8dot3names
fsutil 8dot3name set 1 | Out-Null
# disables NTFS last access updates
fsutil behavior set DisableLastAccess 1 | Out-Null
# disables NTFS compression
fsutil behavior set DisableCompression 1 | Out-Null
# disables the Windows firewall completely
netsh advfirewall set allprofiles state off | Out-Null
# https://www.windowscentral.com/how-permanently-disable-windows-defender-windows-10
dword "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" DisableAntiSpyware 1
# https://winaero.com/blog/disable-windows-defender-security-center/
dword "HKLM:\SYSTEM\CurrentControlSet\Services\SecurityHealthService" Start 4
# disables advertising ID for apps
dword "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" Enabled 0
# disable smart screen filter for store apps
dword "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost" EnableWebContentEvaluation 0
# disable WiFi Sense (hotspot sharing)
dword "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" value 0
# disable Bing search results
dword "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" BingSearchEnabled 0
# disable Telemetry
dword "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" AllowTelemetry 0
Get-Service DiagTrack,Dmwappushservice | Stop-Service | Set-Service -StartupType Disabled | Out-Null
# change Explorer home screen back to "This PC"
dword "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" LaunchTo 1
# disable Quick Access recent files
dword "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" ShowRecent 0
# disable Quick Access frequent folders
dword "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" ShowFrequent 0
# disable lock screen
dword "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization" NoLockScreen 1
# https://www.windowscentral.com/how-disable-image-compression-desktop-wallpapers-windows-10
dword "HKCU:\Control Panel\Desktop" JPEGImportQuality 100
# removes various Metro apps
Get-AppxPackage king.com.CandyCrushSaga | Remove-AppxPackage
Get-AppxPackage Microsoft.BingWeather | Remove-AppxPackage
Get-AppxPackage Microsoft.BingNews | Remove-AppxPackage
Get-AppxPackage Microsoft.BingSports | Remove-AppxPackage
Get-AppxPackage Microsoft.BingFinance | Remove-AppxPackage
#Get-AppxPackage Microsoft.XboxApp | Remove-AppxPackage
Get-AppxPackage Microsoft.WindowsPhone | Remove-AppxPackage
#Get-AppxPackage Microsoft.MicrosoftSolitaireCollection | Remove-AppxPackage
Get-AppxPackage Microsoft.People | Remove-AppxPackage
Get-AppxPackage Microsoft.ZuneMusic | Remove-AppxPackage
Get-AppxPackage Microsoft.ZuneVideo | Remove-AppxPackage
Get-AppxPackage Microsoft.Office.OneNote | Remove-AppxPackage
Get-AppxPackage Microsoft.Windows.Photos | Remove-AppxPackage
Get-AppxPackage Microsoft.WindowsSoundRecorder | Remove-AppxPackage
Get-AppxPackage microsoft.windowscommunicationsapps | Remove-AppxPackage
#Get-AppxPackage Microsoft.SkypeApp | Remove-AppxPackage
# we have to restart for all things to take effect
Restart-Computer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment