-
-
Save berberich/79a606b703ac791d58ba5f6a2c837d10 to your computer and use it in GitHub Desktop.
"Reclaim Windows 10" turns off a bunch of unnecessary Windows 10 telemetery, removes bloatware, and privacy invasions. Review and tweak before running. Scripts for reversing are included and commented. Fork via https://github.com/Disassembler0 (different defaults)
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
########## | |
# Win10 Initial Setup Script | |
# Author: Disassembler <disassembler@dasm.cz> | |
# Version: 1.7, 2016-08-15 | |
# dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/ | |
# THIS IS A PERSONALIZED VERSION | |
# This script leaves more MS defaults on, including MS security features. | |
# Tweaked based on personal preferences for @alirobe 2016-11-16 - v1.7.1 | |
# NOTE: READ THIS SCRIPT CAREFULLY BEFORE RUNNING IT. ADJUST COMMENTS AS APPROPRIATE. | |
# This script will reboot your machine when completed. | |
# Setting up a new machine? See http://ninite.com (for devs, http://chocolatey.org) | |
########## | |
# Ask for elevated permissions if required | |
If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator")) { | |
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs | |
Exit | |
} | |
########## | |
# Privacy Settings | |
########## | |
# Disable Telemetry | |
# Disable Telemetry | |
Write-Host "Disabling Telemetry..." | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\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 | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0 | |
# Disable Wi-Fi Sense | |
Write-Host "Disabling Wi-Fi Sense..." | |
If (!(Test-Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting")) { | |
New-Item -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Force | Out-Null | |
} | |
Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 0 | |
Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 0 | |
# Disable Bing Search in Start Menu | |
Write-Host "Disabling Bing Search in Start Menu..." | |
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Type DWord -Value 0 | |
# Disable Start Menu suggestions | |
Write-Host "Disabling Start Menu suggestions..." | |
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Type DWord -Value 0 | |
# Enable Start Menu suggestions | |
# Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Type DWord -Value 1 | |
# Disable Location Tracking | |
Write-Host "Disabling Location Tracking..." | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value 0 | |
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 0 | |
# Disable Feedback | |
Write-Host "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 | |
# Disable Advertising ID | |
Write-Host "Disabling Advertising ID..." | |
If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo")) { | |
New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" | Out-Null | |
} | |
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -Name "Enabled" -Type DWord -Value 0 | |
# Enable Advertising ID | |
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -Name "Enabled" | |
# Disable Cortana | |
Write-Host "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 | |
# Restrict Windows Update P2P only to local network | |
Write-Host "Restricting Windows Update P2P only to local network..." | |
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 1 | |
If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization")) { | |
New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization" | Out-Null | |
} | |
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization" -Name "SystemSettingsDownloadMode" -Type DWord -Value 3 | |
# Unrestrict Windows Update P2P | |
# Remove-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" | |
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization" -Name "SystemSettingsDownloadMode" | |
# Remove AutoLogger file and restrict directory | |
Write-Host "Removing AutoLogger file and restricting directory..." | |
$autoLoggerDir = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger" | |
If (Test-Path "$autoLoggerDir\AutoLogger-Diagtrack-Listener.etl") { | |
Remove-Item "$autoLoggerDir\AutoLogger-Diagtrack-Listener.etl" | |
} | |
icacls $autoLoggerDir /deny SYSTEM:`(OI`)`(CI`)F | Out-Null | |
# Unrestrict AutoLogger directory | |
# $autoLoggerDir = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger" | |
# icacls $autoLoggerDir /grant:r SYSTEM:`(OI`)`(CI`)F | Out-Null | |
# Stop and disable Diagnostics Tracking Service | |
Write-Host "Stopping and disabling Diagnostics Tracking Service..." | |
Stop-Service "DiagTrack" | |
Set-Service "DiagTrack" -StartupType Disabled | |
# Enable and start Diagnostics Tracking Service | |
# Set-Service "DiagTrack" -StartupType Automatic | |
# Start-Service "DiagTrack" | |
# Stop and disable WAP Push Service | |
Write-Host "Stopping and disabling WAP Push Service..." | |
Stop-Service "dmwappushservice" | |
Set-Service "dmwappushservice" -StartupType Disabled | |
# Enable and start WAP Push Service | |
# Set-Service "dmwappushservice" -StartupType Automatic | |
# Start-Service "dmwappushservice" | |
# Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\dmwappushservice" -Name "DelayedAutoStart" -Type DWord -Value 1 | |
#Win10 - Disable Advertising | |
## Local Machine | |
New-item -Path HKLM:\Software\Policies\Microsoft\Windows -Name CloudContent -ErrorAction SilentlyContinue | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name DisableSoftLanding -Value 1 -Type DWord -Force # Don't show Windows Tips | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name DisableWindowsConsumerFeatures -Value 1 -Type DWord -Force # Disable Windows Consumer Features | |
## Current User | |
New-item -Path HKCU:\Software\Policies\Microsoft\Windows -Name CloudContent -ErrorAction SilentlyContinue | |
Set-ItemProperty -Path "HKCU:\Software\Policies\Microsoft\Windows\CloudContent" -Name DisableWindowsSpotlightFeatures -Value 1 -Type DWord -Force # Disable Windows Spotlot | |
New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -ErrorAction SilentlyContinue | |
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name ShowSyncProviderNotifications -Value 0 -Type DWord -Force # Disable Sync Provider Notifications (AKA ads in Windows Explorer) | |
########## | |
# Service Tweaks | |
########## | |
# Enable Windows Update automatic restart | |
# Set-ItemProperty -Path "HKLM:\Software\Microsoft\WindowsUpdate\UX\Settings" -Name "UxOption" -Type DWord -Value 0 | |
# Stop and disable Home Groups services | |
Write-Host "Stopping and disabling Home Groups services..." | |
Stop-Service "HomeGroupListener" | |
Set-Service "HomeGroupListener" -StartupType Disabled | |
Stop-Service "HomeGroupProvider" | |
Set-Service "HomeGroupProvider" -StartupType Disabled | |
# Disable Remote Assistance | |
Write-Host "Disabling Remote Assistance..." | |
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Type DWord -Value 0 | |
# Enable Remote Assistance | |
# Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Type DWord -Value 1 | |
# Enable Remote Desktop w/o Network Level Authentication | |
# Write-Host "Enabling Remote Desktop w/o Network Level Authentication..." | |
# Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" -Type DWord -Value 0 | |
# Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "UserAuthentication" -Type DWord -Value 0 | |
# Disable Remote Desktop | |
# Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" -Type DWord -Value 1 | |
# Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "UserAuthentication" -Type DWord -Value 1 | |
########## | |
# UI Tweaks | |
########## | |
# Disable Action Center | |
# Write-Host "Disabling Action Center..." | |
# If (!(Test-Path "HKCU:\Software\Policies\Microsoft\Windows\Explorer")) { | |
# New-Item -Path "HKCU:\Software\Policies\Microsoft\Windows\Explorer" | Out-Null | |
# } | |
# Set-ItemProperty -Path "HKCU:\Software\Policies\Microsoft\Windows\Explorer" -Name "DisableNotificationCenter" -Type DWord -Value 1 | |
# Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled" -Type DWord -Value 0 | |
# Enable Action Center | |
# Remove-ItemProperty -Path "HKCU:\Software\Policies\Microsoft\Windows\Explorer" -Name "DisableNotificationCenter" | |
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled" | |
# Disable Lock screen | |
# Write-Host "Disabling Lock screen..." | |
# If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization")) { | |
# New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization" | Out-Null | |
# } | |
# Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization" -Name "NoLockScreen" -Type DWord -Value 1 | |
# Enable Lock screen | |
# Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization" -Name "NoLockScreen" | |
# Disable Lock screen (Anniversary Update workaround) | |
#If ([System.Environment]::OSVersion.Version.Build -gt 14392) { # Apply only for Redstone 1 or newer | |
# $service = New-Object -com Schedule.Service | |
# $service.Connect() | |
# $task = $service.NewTask(0) | |
# $task.Settings.DisallowStartIfOnBatteries = $false | |
# $trigger = $task.Triggers.Create(9) | |
# $trigger = $task.Triggers.Create(11) | |
# $trigger.StateChange = 8 | |
# $action = $task.Actions.Create(0) | |
# $action.Path = "reg.exe" | |
# $action.Arguments = "add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\SessionData /t REG_DWORD /v AllowLockScreen /d 0 /f" | |
# $service.GetFolder("\").RegisterTaskDefinition("Disable LockScreen", $task, 6, "NT AUTHORITY\SYSTEM", $null, 4) | Out-Null | |
#} | |
# Enable Lock screen (Anniversary Update workaround) | |
#If ([System.Environment]::OSVersion.Version.Build -gt 14392) { # Apply only for Redstone 1 or newer | |
# Unregister-ScheduledTask -TaskName "Disable LockScreen" -Confirm:$false -ErrorAction SilentlyContinue | |
#} | |
# Disable Autoplay | |
Write-Host "Disabling Autoplay..." | |
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers" -Name "DisableAutoplay" -Type DWord -Value 1 | |
# Enable Autoplay | |
# Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers" -Name "DisableAutoplay" -Type DWord -Value 0 | |
# Disable Autorun for all drives | |
Write-Host "Disabling Autorun for all drives..." | |
If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer")) { | |
New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" | Out-Null | |
} | |
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "NoDriveTypeAutoRun" -Type DWord -Value 255 | |
# Enable Autorun | |
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "NoDriveTypeAutoRun" | |
#Disable Sticky keys prompt | |
Write-Host "Disabling Sticky keys prompt..." | |
Set-ItemProperty -Path "HKCU:\Control Panel\Accessibility\StickyKeys" -Name "Flags" -Type String -Value "506" | |
# Enable Sticky keys prompt | |
# Set-ItemProperty -Path "HKCU:\Control Panel\Accessibility\StickyKeys" -Name "Flags" -Type String -Value "510" | |
# Hide Search button / box | |
Write-Host "Hiding Search Box / Button..." | |
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode" -Type DWord -Value 0 | |
# Show Search button / box | |
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode" | |
# Hide Task View button | |
# Write-Host "Hiding Task View button..." | |
# Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" -Type DWord -Value 0 | |
# Show Task View button | |
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" | |
# Show small icons in taskbar | |
# Write-Host "Showing small icons in taskbar..." | |
# Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarSmallIcons" -Type DWord -Value 1 | |
# Show large icons in taskbar | |
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarSmallIcons" | |
# Show titles in taskbar | |
# Write-Host "Showing titles in taskbar..." | |
# Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarGlomLevel" -Type DWord -Value 1 | |
# Hide titles in taskbar | |
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarGlomLevel" | |
# Show all tray icons | |
Write-Host "Showing all tray icons..." | |
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray" -Type DWord -Value 0 | |
# Hide tray icons as needed | |
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray" | |
# Show known file extensions | |
Write-Host "Showing known file extensions..." | |
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value 0 | |
# Hide known file extensions | |
# Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value 1 | |
# Show hidden files | |
Write-Host "Showing hidden files..." | |
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Hidden" -Type DWord -Value 1 | |
# Hide hidden files | |
# Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Hidden" -Type DWord -Value 2 | |
# Change default Explorer view to "Computer" | |
Write-Host "Changing default Explorer view to `"Computer`"..." | |
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo" -Type DWord -Value 1 | |
# Remove Music icon from computer namespace | |
Write-Host "Removing Music icon from computer namespace..." | |
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 | |
# Remove Pictures icon from computer namespace | |
Write-Host "Removing Pictures icon from computer namespace..." | |
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 | |
# Add Pictures icon to computer namespace | |
# New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}" | |
# New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3ADD1653-EB32-4cb0-BBD7-DFA0ABB5ACCA}" | |
# Remove Videos icon from computer namespace | |
Write-Host "Removing Videos icon from computer namespace..." | |
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 | |
## Add secondary en-US keyboard | |
#Write-Host "Adding secondary en-US keyboard..." | |
#$langs = Get-WinUserLanguageList | |
#$langs.Add("en-US") | |
#Set-WinUserLanguageList $langs -Force | |
# Remove secondary en-US keyboard | |
# $langs = Get-WinUserLanguageList | |
# Set-WinUserLanguageList ($langs | ? {$_.LanguageTag -ne "en-US"}) -Force | |
########## | |
# Remove unwanted applications | |
########## | |
# Disable OneDrive | |
# Write-Host "Disabling OneDrive..." | |
# 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 | |
# Enable OneDrive | |
# Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "DisableFileSyncNGSC" | |
# Uninstall OneDrive | |
Write-Host "Uninstalling OneDrive..." | |
Stop-Process -Name OneDrive -ErrorAction SilentlyContinue | |
Start-Sleep -s 3 | |
$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 3 | |
Stop-Process -Name explorer -ErrorAction SilentlyContinue | |
Start-Sleep -s 3 | |
Remove-Item "$env:USERPROFILE\OneDrive" -Force -Recurse -ErrorAction SilentlyContinue | |
Remove-Item "$env:LOCALAPPDATA\Microsoft\OneDrive" -Force -Recurse -ErrorAction SilentlyContinue | |
Remove-Item "$env:PROGRAMDATA\Microsoft OneDrive" -Force -Recurse -ErrorAction SilentlyContinue | |
If (Test-Path "$env:SYSTEMDRIVE\OneDriveTemp") { | |
Remove-Item "$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 | |
# Uninstall default bloatware | |
Write-Host "Uninstalling default bloatware..." | |
Get-AppxPackage "Microsoft.3DBuilder" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.BingFinance" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.BingNews" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.BingSports" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.BingWeather" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.Getstarted" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.MicrosoftOfficeHub" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.MicrosoftSolitaireCollection" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.Office.OneNote" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.People" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.SkypeApp" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.Windows.Photos" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.WindowsAlarms" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.WindowsCamera" | Remove-AppxPackage | |
Get-AppxPackage "microsoft.windowscommunicationsapps" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.WindowsMaps" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.WindowsPhone" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.WindowsSoundRecorder" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.XboxApp" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.ZuneMusic" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.ZuneVideo" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.AppConnector" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.ConnectivityStore" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.Office.Sway" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.Messaging" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.CommsPhone" | Remove-AppxPackage | |
Get-AppxPackage "Facebook.Facebook" | Remove-AppxPackage | |
Get-AppxPackage "9E2F88E3.Twitter" | Remove-AppxPackage | |
Get-AppxPackage "king.com.CandyCrushSodaSaga" | Remove-AppxPackage | |
Get-AppxPackage "4DF9E0F8.Netflix" | Remove-AppxPackage | |
Get-AppxPackage "Drawboard.DrawboardPDF" | Remove-AppxPackage | |
# Get-AppxPackage "Microsoft.MicrosoftStickyNotes" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.OneConnect" | Remove-AppxPackage | |
Get-AppxPackage "D52A8D61.FarmVille2CountryEscape" | Remove-AppxPackage | |
Get-AppxPackage "A278AB0D.MarchofEmpires" | Remove-AppxPackage | |
Get-AppxPackage "GAMELOFTSA.Asphalt8Airborne" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.MinecraftUWP" | Remove-AppxPackage | |
Get-AppxPackage "Microsoft.WindowsFeedbackHub" | Remove-AppxPackage | |
Get-AppxPackage "SlingTVLLC.SlingTV" | Remove-AppxPackage | |
Get-AppxPackage "KeeperSecurityInc.Keeper" | Remove-AppxPackage | |
# Disable Xbox DVR | |
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR")) { | |
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" | Out-Null | |
} | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" -Name "AllowGameDVR" -Type DWord -Value 0 | |
# Set Photo Viewer as default for bmp, gif, jpg and png | |
Write-Host "Setting Photo Viewer as default 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" | |
} | |
# Show Photo Viewer in "Open with..." | |
Write-Host "Showing Photo Viewer in `"Open with...`"" | |
If (!(Test-Path "HKCR:")) { | |
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null | |
} | |
New-Item -Path "HKCR:\Applications\photoviewer.dll\shell\open\command" -Force | Out-Null | |
New-Item -Path "HKCR:\Applications\photoviewer.dll\shell\open\DropTarget" -Force | Out-Null | |
Set-ItemProperty -Path "HKCR:\Applications\photoviewer.dll\shell\open" -Name "MuiVerb" -Type String -Value "@photoviewer.dll,-3043" | |
Set-ItemProperty -Path "HKCR:\Applications\photoviewer.dll\shell\open\command" -Name "(Default)" -Type ExpandString -Value "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1" | |
Set-ItemProperty -Path "HKCR:\Applications\photoviewer.dll\shell\open\DropTarget" -Name "Clsid" -Type String -Value "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}" | |
# Enable F8 boot menu options | |
# Write-Host "Enabling F8 boot menu options..." | |
# bcdedit /set `{current`} bootmenupolicy Legacy | Out-Null | |
# Disable F8 boot menu options | |
# bcdedit /set `{current`} bootmenupolicy Standard | Out-Null | |
# Install Powershell man pages locally (low priority, uses bandwidth) | |
# Update-Help | |
########## | |
# Restart | |
########## | |
Write-Host | |
Write-Host "Press any key to restart your system..." -ForegroundColor Black -BackgroundColor White | |
$key = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | |
Write-Host "Restarting..." | |
Restart-Computer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment