├── README.md └── debloat.ps1 /README.md: -------------------------------------------------------------------------------- 1 | # Windows Debloater 2 | A simple powershell script to debloat Windows. 3 | 4 | ### How to Use: 5 | 1. Download/clone this repo. 6 | 2. Right Click on start button & open Powershell(Admin) 7 | 3. This step depends on where you have downloaded the script. 8 | We will assume that you have downloaded this scipt in downloads. 9 | ``` 10 | cd .. 11 | cd C:\Users\\Downloads\ 12 | cd .\Windows-Debloater-main\Windows-Debloater-main\ 13 | ``` 14 | 4. Type the following commands : 15 | ``` 16 | Set-ExecutionPolicy Unrestricted 17 | ``` 18 | ``` 19 | .\debloat.ps1 20 | ``` 21 | *Note : Make sure to enable/disable the features you don't need by commenting/uncommenting them out.* 22 | 23 | ### What this script can do : 24 | 1. Enable/Disable Telemetry 25 | 2. Enable/Disable Wi-Fi Sense 26 | 3. Enable/Disable SmartScreen Filter 27 | 4. Enable/Disable Bing Search in Start Menu 28 | 5. Enable/Disable Location Tracking 29 | 6. Enable/Disable Feedback 30 | 7. Enable/Disable Advertising ID 31 | 8. Enable/Disable Cortana 32 | 9. Restrict Windows Update P2P only to local network 33 | 10. Remove AutoLogger file & restrict directory 34 | 11. Stop & disable Diagnostics Tracking Service 35 | 12. Lower/Raise UAC level 36 | 13. Enable/Disable sharing mapped drives between users 37 | 14. Enable/Disable Firewall 38 | 15. Enable/Disable Windows Defender 39 | 16. Enable/Disable Windows Update automatic restart 40 | 17. Stop & disable Home Groups services 41 | 18. Enable/Disable Remote Assistance 42 | 19. Enable/Disable Remote Desktop w/o Network Level Authentication 43 | 20. Enable/Disable Action Center 44 | 21. Enable/Disable Lock screen 45 | 22. Enable/Disable Autoplay 46 | 23. Enable/Disable Autorun for all drives 47 | 24. Enable/Disable Sticky keys prompt 48 | 25. Hide/Show Search button / box 49 | 26. Hide/Show Task View button 50 | 27. Hide/Show small/large icons in taskbar 51 | 28. Hide/Show titles in taskbar 52 | 29. Hide/Show all tray icons 53 | 30. Hide/Show known file extensions 54 | 31. Change default Explorer view to "Computer"/"Quick Access" 55 | 32. Hide/Show Computer shortcut on desktop 56 | 33. Remove Desktop icon from computer namespace 57 | 34. Remove Documents icon from computer namespace 58 | 35. Remove Downloads icon from computer namespace 59 | 36. Remove Downloads icon to computer namespace 60 | 37. Remove Music icon from computer namespace 61 | 38. Remove Pictures icon from computer namespace 62 | 39. Remove Videos icon from computer namespace 63 | 40. Remove secondary en-US keyboard 64 | 41. Enable/Disable/Uninstall OneDrive 65 | 42. Install/Uninstall default Microsoft applications 66 | 43. Uninstall Work Folders Client 67 | 44. Enable/Disable unwanted Windows services 68 | 45. Enable/Disable many of the default apps. 69 | 46. Prevents Apps from re-installing 70 | 47. Remove/Set Password Age Limit 71 | 48. Enable/Disable Privacy Settings Experience 72 | 49. Sets Windows to Dark Mode 73 | 74 | ### Defaults: 75 | By default this script has options enabled for a normal user. 76 | 1. Telemetry is disabled. 77 | 2. Wi-Fi sense is disabled. 78 | 3. SmartScreen Filter is disabled. 79 | 4. Bing Search diabled in Start Menu. 80 | 5. Location Tracking is disabled. 81 | 6. Feedback is disabled. 82 | 7. Advertising ID is disabled. 83 | 8. Cortana is disabled. 84 | 9. Restricted Windows Update P2P only to local network. 85 | 10. Removed AutoLogger file and restrict directory. 86 | 11. Stopped and disabled Diagnostics Tracking Service. 87 | 12. Disabled Windows Update automatic restart. 88 | 13. Stoped and disabled Home Groups services. 89 | 14. Show known file extensions. 90 | 15. Change default Explorer view to "Computer" 91 | 16. Disabled OneDrive. 92 | 17. It removes some of the bloatware bundled with Windows 10 : 93 | 1. 3DBuilder 94 | 2. BingFinance 95 | 3. BingNews 96 | 4. BingSports 97 | 5. BingWeather 98 | 6. Getstarted 99 | 7. People 100 | 8. SkypeApp 101 | 9. WindowsMaps 102 | 10. WindowsPhone 103 | 11. WindowsSoundRecorder 104 | 12. AppConnector 105 | 13. Messaging 106 | 14. CommsPhone 107 | 15. CandyCrushSodaSaga 108 | 16. WindowsFeedbackHub 109 | 17. Wallet 110 | 18. GetHelp 111 | 19. MixedReality 112 | 20. Everything Office related. 113 | 21. Everything Xbox related. 114 | 22. WindowsCamera 115 | 18. Disables all settings in Privacy Experience. 116 | 19. Disable Remote Assistance 117 | 20. Disable Remote Desktop 118 | 119 | #### Credits : 120 | [@Disassembler0]( https://github.com/Disassembler0 ). 121 | [Craft Computing]( https://www.youtube.com/channel/UCp3yVOm6A55nx65STpm3tXQ ). 122 | Windows Debloat Video URL : https://www.youtube.com/watch?v=PdKMiFKGQuc
123 | -------------------------------------------------------------------------------- /debloat.ps1: -------------------------------------------------------------------------------- 1 | ########## 2 | # Win10 Initial Setup Script 3 | # Author: Disassembler 4 | # Version: 1.4, 2016-01-16 5 | ########## 6 | 7 | # Ask for elevated permissions if required 8 | If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator")) { 9 | Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs 10 | Exit 11 | } 12 | 13 | 14 | 15 | ########## 16 | # Privacy Settings 17 | ########## 18 | 19 | # Disable Telemetry 20 | Write-Host "Disabling Telemetry..." 21 | Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0 22 | 23 | # Enable Telemetry 24 | # Remove-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" 25 | 26 | # Disable Wi-Fi Sense 27 | Write-Host "Disabling Wi-Fi Sense..." 28 | If (!(Test-Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting")) { 29 | New-Item -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Force | Out-Null 30 | } 31 | Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 0 32 | Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 0 33 | 34 | # Enable Wi-Fi Sense 35 | # Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 1 36 | # Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 1 37 | 38 | # Disable SmartScreen Filter 39 | Write-Host "Disabling SmartScreen Filter..." 40 | Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "SmartScreenEnabled" -Type String -Value "Off" 41 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AppHost" -Name "EnableWebContentEvaluation" -Type DWord -Value 0 42 | 43 | # Enable SmartScreen Filter 44 | # Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "SmartScreenEnabled" -Type String -Value "RequireAdmin" 45 | # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AppHost" -Name "EnableWebContentEvaluation" 46 | 47 | # Disable Bing Search in Start Menu 48 | Write-Host "Disabling Bing Search in Start Menu..." 49 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Type DWord -Value 0 50 | 51 | # Enable Bing Search in Start Menu 52 | # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" 53 | 54 | # Disable Location Tracking 55 | Write-Host "Disabling Location Tracking..." 56 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value 0 57 | Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 0 58 | 59 | # Enable Location Tracking 60 | # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value 1 61 | # Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 1 62 | 63 | # Disable Feedback 64 | Write-Host "Disabling Feedback..." 65 | If (!(Test-Path "HKCU:\Software\Microsoft\Siuf\Rules")) { 66 | New-Item -Path "HKCU:\Software\Microsoft\Siuf\Rules" -Force | Out-Null 67 | } 68 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -Type DWord -Value 0 69 | 70 | # Enable Feedback 71 | # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" 72 | 73 | # Disable Advertising ID 74 | Write-Host "Disabling Advertising ID..." 75 | If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo")) { 76 | New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" | Out-Null 77 | } 78 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -Name "Enabled" -Type DWord -Value 0 79 | 80 | # Enable Advertising ID 81 | # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -Name "Enabled" 82 | 83 | # Disable Cortana 84 | Write-Host "Disabling Cortana..." 85 | If (!(Test-Path "HKCU:\Software\Microsoft\Personalization\Settings")) { 86 | New-Item -Path "HKCU:\Software\Microsoft\Personalization\Settings" -Force | Out-Null 87 | } 88 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -Type DWord -Value 0 89 | If (!(Test-Path "HKCU:\Software\Microsoft\InputPersonalization")) { 90 | New-Item -Path "HKCU:\Software\Microsoft\InputPersonalization" -Force | Out-Null 91 | } 92 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 1 93 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 1 94 | If (!(Test-Path "HKCU:\Software\Microsoft\InputPersonalization\TrainedDataStore")) { 95 | New-Item -Path "HKCU:\Software\Microsoft\InputPersonalization\TrainedDataStore" -Force | Out-Null 96 | } 97 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -Type DWord -Value 0 98 | 99 | # Enable Cortana 100 | # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" 101 | # Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 0 102 | # Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 0 103 | # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" 104 | 105 | # Restrict Windows Update P2P only to local network 106 | Write-Host "Restricting Windows Update P2P only to local network..." 107 | Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 1 108 | If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization")) { 109 | New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization" | Out-Null 110 | } 111 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization" -Name "SystemSettingsDownloadMode" -Type DWord -Value 3 112 | 113 | # Unrestrict Windows Update P2P 114 | # Remove-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" 115 | # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization" -Name "SystemSettingsDownloadMode" 116 | 117 | # Remove AutoLogger file and restrict directory 118 | Write-Host "Removing AutoLogger file and restricting directory..." 119 | $autoLoggerDir = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger" 120 | If (Test-Path "$autoLoggerDir\AutoLogger-Diagtrack-Listener.etl") { 121 | Remove-Item "$autoLoggerDir\AutoLogger-Diagtrack-Listener.etl" 122 | } 123 | icacls $autoLoggerDir /deny SYSTEM:`(OI`)`(CI`)F | Out-Null 124 | 125 | # Unrestrict AutoLogger directory 126 | # $autoLoggerDir = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger" 127 | # icacls $autoLoggerDir /grant:r SYSTEM:`(OI`)`(CI`)F | Out-Null 128 | 129 | # Stop and disable Diagnostics Tracking Service 130 | Write-Host "Stopping and disabling Diagnostics Tracking Service..." 131 | Stop-Service "DiagTrack" 132 | Set-Service "DiagTrack" -StartupType Disabled 133 | 134 | # Enable and start Diagnostics Tracking Service 135 | # Set-Service "DiagTrack" -StartupType Automatic 136 | # Start-Service "DiagTrack" 137 | 138 | ########## 139 | # Service Tweaks 140 | ########## 141 | 142 | # Lower UAC level 143 | # Write-Host "Lowering UAC level..." 144 | # Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Type DWord -Value 0 145 | # Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "PromptOnSecureDesktop" -Type DWord -Value 0 146 | 147 | # Raise UAC level 148 | # Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Type DWord -Value 5 149 | # Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "PromptOnSecureDesktop" -Type DWord -Value 1 150 | 151 | # Enable sharing mapped drives between users 152 | # Write-Host "Enabling sharing mapped drives between users..." 153 | # Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "EnableLinkedConnections" -Type DWord -Value 1 154 | 155 | # Disable sharing mapped drives between users 156 | # Remove-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "EnableLinkedConnections" 157 | 158 | # Disable Firewall 159 | # Write-Host "Disabling Firewall..." 160 | # Set-NetFirewallProfile -Profile * -Enabled False 161 | 162 | # Enable Firewall 163 | # Set-NetFirewallProfile -Profile * -Enabled True 164 | 165 | # Disable Windows Defender 166 | # Write-Host "Disabling Windows Defender..." 167 | # Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows Defender" -Name "DisableAntiSpyware" -Type DWord -Value 1 168 | 169 | # Enable Windows Defender 170 | # Remove-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows Defender" -Name "DisableAntiSpyware" 171 | 172 | # Disable Windows Update automatic restart 173 | Write-Host "Disabling Windows Update automatic restart..." 174 | Set-ItemProperty -Path "HKLM:\Software\Microsoft\WindowsUpdate\UX\Settings" -Name "UxOption" -Type DWord -Value 1 175 | 176 | # Enable Windows Update automatic restart 177 | # Set-ItemProperty -Path "HKLM:\Software\Microsoft\WindowsUpdate\UX\Settings" -Name "UxOption" -Type DWord -Value 0 178 | 179 | # Stop and disable Home Groups services 180 | Write-Host "Stopping and disabling Home Groups services..." 181 | Stop-Service "HomeGroupListener" 182 | Set-Service "HomeGroupListener" -StartupType Disabled 183 | Stop-Service "HomeGroupProvider" 184 | Set-Service "HomeGroupProvider" -StartupType Disabled 185 | 186 | # Enable and start Home Groups services 187 | # Set-Service "HomeGroupListener" -StartupType Manual 188 | # Set-Service "HomeGroupProvider" -StartupType Manual 189 | # Start-Service "HomeGroupProvider" 190 | 191 | # Disable Remote Assistance 192 | Write-Host "Disabling Remote Assistance..." 193 | Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Type DWord -Value 0 194 | 195 | # Enable Remote Assistance 196 | # Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Type DWord -Value 1 197 | 198 | # Enable Remote Desktop w/o Network Level Authentication 199 | # Write-Host "Enabling Remote Desktop w/o Network Level Authentication..." 200 | # Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" -Type DWord -Value 0 201 | # Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "UserAuthentication" -Type DWord -Value 0 202 | 203 | # Disable Remote Desktop 204 | Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" -Type DWord -Value 1 205 | Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "UserAuthentication" -Type DWord -Value 1 206 | 207 | ########## 208 | # UI Tweaks 209 | ########## 210 | 211 | # Disable Action Center 212 | # Write-Host "Disabling Action Center..." 213 | # If (!(Test-Path "HKCU:\Software\Policies\Microsoft\Windows\Explorer")) { 214 | # New-Item -Path "HKCU:\Software\Policies\Microsoft\Windows\Explorer" | Out-Null 215 | # } 216 | # Set-ItemProperty -Path "HKCU:\Software\Policies\Microsoft\Windows\Explorer" -Name "DisableNotificationCenter" -Type DWord -Value 1 217 | # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled" -Type DWord -Value 0 218 | 219 | # Enable Action Center 220 | # Remove-ItemProperty -Path "HKCU:\Software\Policies\Microsoft\Windows\Explorer" -Name "DisableNotificationCenter" 221 | # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled" 222 | 223 | # Disable Lock screen 224 | # Write-Host "Disabling Lock screen..." 225 | # If (!(Test-Path "HKLM:\Software\Policies\Microsoft\Windows\Personalization")) { 226 | # New-Item -Path "HKLM:\Software\Policies\Microsoft\Windows\Personalization" | Out-Null 227 | # } 228 | # Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\Personalization" -Name "NoLockScreen" -Type DWord -Value 1 229 | 230 | # Enable Lock screen 231 | # Remove-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\Personalization" -Name "NoLockScreen" 232 | 233 | # Disable Autoplay 234 | # Write-Host "Disabling Autoplay..." 235 | # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers" -Name "DisableAutoplay" -Type DWord -Value 1 236 | 237 | # Enable Autoplay 238 | # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers" -Name "DisableAutoplay" -Type DWord -Value 0 239 | 240 | # Disable Autorun for all drives 241 | # Write-Host "Disabling Autorun for all drives..." 242 | # If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer")) { 243 | # New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" | Out-Null 244 | #} 245 | # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "NoDriveTypeAutoRun" -Type DWord -Value 255 246 | 247 | # Enable Autorun 248 | # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "NoDriveTypeAutoRun" 249 | 250 | # Disable Sticky keys prompt 251 | # Write-Host "Disabling Sticky keys prompt..." 252 | # Set-ItemProperty -Path "HKCU:\Control Panel\Accessibility\StickyKeys" -Name "Flags" -Type String -Value "506" 253 | 254 | # Enable Sticky keys prompt 255 | # Set-ItemProperty -Path "HKCU:\Control Panel\Accessibility\StickyKeys" -Name "Flags" -Type String -Value "510" 256 | 257 | # Hide Search button / box 258 | Write-Host "Hiding Search Box / Button..." 259 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode" -Type DWord -Value 0 260 | 261 | # Show Search button / box 262 | # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode" 263 | 264 | # Hide Task View button 265 | # Write-Host "Hiding Task View button..." 266 | # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" -Type DWord -Value 0 267 | 268 | # Show Task View button 269 | # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" 270 | 271 | # Show small icons in taskbar 272 | # Write-Host "Showing small icons in taskbar..." 273 | # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarSmallIcons" -Type DWord -Value 1 274 | 275 | # Show large icons in taskbar 276 | # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarSmallIcons" 277 | 278 | # Show titles in taskbar 279 | # Write-Host "Showing titles in taskbar..." 280 | # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarGlomLevel" -Type DWord -Value 1 281 | 282 | # Hide titles in taskbar 283 | # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarGlomLevel" 284 | 285 | # Show all tray icons 286 | # Write-Host "Showing all tray icons..." 287 | # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray" -Type DWord -Value 0 288 | 289 | # Hide tray icons as needed 290 | # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray" 291 | 292 | # Show known file extensions 293 | Write-Host "Showing known file extensions..." 294 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value 0 295 | 296 | # Hide known file extensions 297 | # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value 1 298 | 299 | # Show hidden files 300 | # Write-Host "Showing hidden files..." 301 | # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Hidden" -Type DWord -Value 1 302 | 303 | # Hide hidden files 304 | # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Hidden" -Type DWord -Value 2 305 | 306 | # Change default Explorer view to "Computer" 307 | Write-Host "Changing default Explorer view to `"Computer`"..." 308 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo" -Type DWord -Value 1 309 | 310 | # Change default Explorer view to "Quick Access" 311 | # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo" 312 | 313 | # Show Computer shortcut on desktop 314 | # Write-Host "Showing Computer shortcut on desktop..." 315 | # If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu")) { 316 | # New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" | Out-Null 317 | # } 318 | # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -Type DWord -Value 0 319 | # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -Type DWord -Value 0 320 | 321 | # Hide Computer shortcut from desktop 322 | # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" 323 | # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" 324 | 325 | # Remove Desktop icon from computer namespace 326 | # Write-Host "Removing Desktop icon from computer namespace..." 327 | # Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}" -Recurse -ErrorAction SilentlyContinue 328 | 329 | # Add Desktop icon to computer namespace 330 | # New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}" 331 | 332 | # Remove Documents icon from computer namespace 333 | # Write-Host "Removing Documents icon from computer namespace..." 334 | # Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}" -Recurse -ErrorAction SilentlyContinue 335 | # Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}" -Recurse -ErrorAction SilentlyContinue 336 | 337 | # Add Documents icon to computer namespace 338 | # New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}" 339 | # New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}" 340 | 341 | # Remove Downloads icon from computer namespace 342 | # Write-Host "Removing Downloads icon from computer namespace..." 343 | # Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{088e3905-0323-4b02-9826-5d99428e115f}" -Recurse -ErrorAction SilentlyContinue 344 | # Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{374DE290-123F-4565-9164-39C4925E467B}" -Recurse -ErrorAction SilentlyContinue 345 | 346 | # Add Downloads icon to computer namespace 347 | # New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{088e3905-0323-4b02-9826-5d99428e115f}" 348 | # New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{374DE290-123F-4565-9164-39C4925E467B}" 349 | 350 | # Remove Music icon from computer namespace 351 | # Write-Host "Removing Music icon from computer namespace..." 352 | # Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}" -Recurse -ErrorAction SilentlyContinue 353 | # Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}" -Recurse -ErrorAction SilentlyContinue 354 | 355 | # Add Music icon to computer namespace 356 | # New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}" 357 | # New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}" 358 | 359 | # Remove Pictures icon from computer namespace 360 | # Write-Host "Removing Pictures icon from computer namespace..." 361 | # Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}" -Recurse -ErrorAction SilentlyContinue 362 | # Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3ADD1653-EB32-4cb0-BBD7-DFA0ABB5ACCA}" -Recurse -ErrorAction SilentlyContinue 363 | 364 | # Add Pictures icon to computer namespace 365 | # New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}" 366 | # New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3ADD1653-EB32-4cb0-BBD7-DFA0ABB5ACCA}" 367 | 368 | # Remove Videos icon from computer namespace 369 | # Write-Host "Removing Videos icon from computer namespace..." 370 | # Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}" -Recurse -ErrorAction SilentlyContinue 371 | # Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}" -Recurse -ErrorAction SilentlyContinue 372 | 373 | # Add Videos icon to computer namespace 374 | # New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}" 375 | # New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}" 376 | 377 | # Remove 3D Objects icon from computer namespace 378 | # Write-Host "Removing 3D Objects icon from computer namespace..." 379 | # Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" -Recurse -ErrorAction SilentlyContinue 380 | 381 | # Add 3D Objects icon to computer namespace 382 | # New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" 383 | 384 | ## Add secondary en-US keyboard 385 | #Write-Host "Adding secondary en-US keyboard..." 386 | #$langs = Get-WinUserLanguageList 387 | #$langs.Add("en-US") 388 | #Set-WinUserLanguageList $langs -Force 389 | 390 | # Remove secondary en-US keyboard 391 | # $langs = Get-WinUserLanguageList 392 | # Set-WinUserLanguageList ($langs | ? {$_.LanguageTag -ne "en-US"}) -Force 393 | 394 | 395 | 396 | ########## 397 | # Remove unwanted applications 398 | ########## 399 | 400 | # Disable OneDrive 401 | Write-Host "Disabling OneDrive..." 402 | If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive")) { 403 | New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" | Out-Null 404 | } 405 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "DisableFileSyncNGSC" -Type DWord -Value 1 406 | 407 | # Enable OneDrive 408 | # Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "DisableFileSyncNGSC" 409 | 410 | # Uninstall OneDrive (WINDOWS WILL NOT SYSPREP WITHOUT IT!) 411 | # Write-Host "Uninstalling OneDrive..." 412 | # Stop-Process -Name OneDrive -ErrorAction SilentlyContinue 413 | # Start-Sleep -s 3 414 | # $onedrive = "$env:SYSTEMROOT\SysWOW64\OneDriveSetup.exe" 415 | # If (!(Test-Path $onedrive)) { 416 | # $onedrive = "$env:SYSTEMROOT\System32\OneDriveSetup.exe" 417 | # } 418 | # Start-Process $onedrive "/uninstall" -NoNewWindow -Wait 419 | # Start-Sleep -s 3 420 | # Stop-Process -Name explorer -ErrorAction SilentlyContinue 421 | # Start-Sleep -s 3 422 | # Remove-Item "$env:USERPROFILE\OneDrive" -Force -Recurse -ErrorAction SilentlyContinue 423 | # Remove-Item "$env:LOCALAPPDATA\Microsoft\OneDrive" -Force -Recurse -ErrorAction SilentlyContinue 424 | # Remove-Item "$env:PROGRAMDATA\Microsoft OneDrive" -Force -Recurse -ErrorAction SilentlyContinue 425 | # If (Test-Path "$env:SYSTEMDRIVE\OneDriveTemp") { 426 | # Remove-Item "$env:SYSTEMDRIVE\OneDriveTemp" -Force -Recurse -ErrorAction SilentlyContinue 427 | # } 428 | # If (!(Test-Path "HKCR:")) { 429 | # New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null 430 | # } 431 | # Remove-Item -Path "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -Recurse -ErrorAction SilentlyContinue 432 | # Remove-Item -Path "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -Recurse -ErrorAction SilentlyContinue 433 | 434 | # Install OneDrive 435 | # $onedrive = "$env:SYSTEMROOT\SysWOW64\OneDriveSetup.exe" 436 | # If (!(Test-Path $onedrive)) { 437 | # $onedrive = "$env:SYSTEMROOT\System32\OneDriveSetup.exe" 438 | # } 439 | # Start-Process $onedrive -NoNewWindow 440 | 441 | # Uninstall default Microsoft applications 442 | Write-Host "Uninstalling default Microsoft applications..." 443 | Get-AppxPackage "Microsoft.3DBuilder" | Remove-AppxPackage 444 | Get-AppxPackage "Microsoft.BingFinance" | Remove-AppxPackage 445 | Get-AppxPackage "Microsoft.BingNews" | Remove-AppxPackage 446 | Get-AppxPackage "Microsoft.BingSports" | Remove-AppxPackage 447 | Get-AppxPackage "Microsoft.BingWeather" | Remove-AppxPackage 448 | Get-AppxPackage "Microsoft.Getstarted" | Remove-AppxPackage 449 | Get-AppxPackage "Microsoft.MicrosoftOfficeHub" | Remove-AppxPackage 450 | Get-AppxPackage "Microsoft.MicrosoftSolitaireCollection" | Remove-AppxPackage 451 | Get-AppxPackage "Microsoft.Office.OneNote" | Remove-AppxPackage 452 | Get-AppxPackage "Microsoft.People" | Remove-AppxPackage 453 | Get-AppxPackage "Microsoft.SkypeApp" | Remove-AppxPackage 454 | # Get-AppxPackage "Microsoft.Windows.Photos" | Remove-AppxPackage 455 | # Get-AppxPackage "Microsoft.WindowsAlarms" | Remove-AppxPackage 456 | Get-AppxPackage "Microsoft.WindowsCamera" | Remove-AppxPackage 457 | Get-AppxPackage "microsoft.windowscommunicationsapps" | Remove-AppxPackage 458 | Get-AppxPackage "Microsoft.WindowsMaps" | Remove-AppxPackage 459 | Get-AppxPackage "Microsoft.WindowsPhone" | Remove-AppxPackage 460 | Get-AppxPackage "Microsoft.WindowsSoundRecorder" | Remove-AppxPackage 461 | Get-AppxPackage "Microsoft.XboxApp" | Remove-AppxPackage 462 | # Get-AppxPackage "Microsoft.ZuneMusic" | Remove-AppxPackage 463 | # Get-AppxPackage "Microsoft.ZuneVideo" | Remove-AppxPackage 464 | Get-AppxPackage "Microsoft.AppConnector" | Remove-AppxPackage 465 | Get-AppxPackage "Microsoft.ConnectivityStore" | Remove-AppxPackage 466 | Get-AppxPackage "Microsoft.Office.Sway" | Remove-AppxPackage 467 | Get-AppxPackage "Microsoft.Messaging" | Remove-AppxPackage 468 | Get-AppxPackage "Microsoft.CommsPhone" | Remove-AppxPackage 469 | Get-AppxPackage "9E2F88E3.Twitter" | Remove-AppxPackage 470 | Get-AppxPackage "king.com.CandyCrushSodaSaga" | Remove-AppxPackage 471 | Get-AppxPackage "Microsoft.WindowsFeedbackHub" | Remove-AppxPackage 472 | Get-AppxPackage "Microsoft.Wallet" | Remove-AppxPackage 473 | # Get-AppxPackage "Microsoft.ScreenSketch" | Remove-AppxPackage 474 | Get-AppxPackage "Microsoft.GetHelp" | Remove-AppxPackage 475 | Get-AppxPackage "Microsoft.Xbox.TCUI" | Remove-AppxPackage 476 | Get-AppxPackage "Microsoft.XboxGameOverlay" | Remove-AppxPackage 477 | Get-AppxPackage "Microsoft.XboxSpeechToTextOverlay" | Remove-AppxPackage 478 | Get-AppxPackage "Microsoft.MixedReality.Portal" | Remove-AppxPackage 479 | Get-AppxPackage "Microsoft.XboxIdentityProvider" | Remove-AppPackage 480 | Get-AppxPackage "5A894077.McAfeeSecurity" | Remove-AppPackage 481 | Get-AppxPackage "Disney.37853FC22B2CE" | Remove-AppPackage 482 | Get-AppxPackage "Microsoft.GamingApp" | Remove-AppPackage 483 | Get-AppxPackage "Facebook.InstagramBeta" | Remove-AppPackage 484 | Get-AppxPackage "AdobeSystemsIncorporated.AdobeCreativeCloudExpress" | Remove-AppPackage 485 | Get-AppxPackage "AmazonVideo.PrimeVideo" | Remove-AppPackage 486 | Get-AppxPackage "BytedancePte.Ltd.TikTok" | Remove-AppPackage 487 | 488 | 489 | # Install default Microsoft applications 490 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.3DBuilder").InstallLocation)\AppXManifest.xml" 491 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.BingFinance").InstallLocation)\AppXManifest.xml" 492 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.BingNews").InstallLocation)\AppXManifest.xml" 493 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.BingSports").InstallLocation)\AppXManifest.xml" 494 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.BingWeather").InstallLocation)\AppXManifest.xml" 495 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.Getstarted").InstallLocation)\AppXManifest.xml" 496 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.MicrosoftOfficeHub").InstallLocation)\AppXManifest.xml" 497 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.MicrosoftSolitaireCollection").InstallLocation)\AppXManifest.xml" 498 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.Office.OneNote").InstallLocation)\AppXManifest.xml" 499 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.People").InstallLocation)\AppXManifest.xml" 500 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.SkypeApp").InstallLocation)\AppXManifest.xml" 501 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.Windows.Photos").InstallLocation)\AppXManifest.xml" 502 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.WindowsAlarms").InstallLocation)\AppXManifest.xml" 503 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.WindowsCamera").InstallLocation)\AppXManifest.xml" 504 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.windowscommunicationsapps").InstallLocation)\AppXManifest.xml" 505 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.WindowsMaps").InstallLocation)\AppXManifest.xml" 506 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.WindowsPhone").InstallLocation)\AppXManifest.xml" 507 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.WindowsSoundRecorder").InstallLocation)\AppXManifest.xml" 508 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.XboxApp").InstallLocation)\AppXManifest.xml" 509 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.ZuneMusic").InstallLocation)\AppXManifest.xml" 510 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.ZuneVideo").InstallLocation)\AppXManifest.xml" 511 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.AppConnector").InstallLocation)\AppXManifest.xml" 512 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.ConnectivityStore").InstallLocation)\AppXManifest.xml" 513 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.Office.Sway").InstallLocation)\AppXManifest.xml" 514 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.Messaging").InstallLocation)\AppXManifest.xml" 515 | # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.CommsPhone").InstallLocation)\AppXManifest.xml" 516 | # In case you have removed them for good, you can try to restore the files using installation medium as follows 517 | # New-Item C:\Mnt -Type Directory | Out-Null 518 | # dism /Mount-Image /ImageFile:D:\sources\install.wim /index:1 /ReadOnly /MountDir:C:\Mnt 519 | # robocopy /S /SEC /R:0 "C:\Mnt\Program Files\WindowsApps" "C:\Program Files\WindowsApps" 520 | # dism /Unmount-Image /Discard /MountDir:C:\Mnt 521 | # Remove-Item -Path C:\Mnt -Recurse 522 | 523 | # Uninstall Windows Media Player 524 | # Write-Host "Uninstalling Windows Media Player..." 525 | # dism /online /Disable-Feature /FeatureName:MediaPlayback /Quiet /NoRestart 526 | 527 | # Install Windows Media Player 528 | # dism /online /Enable-Feature /FeatureName:MediaPlayback /Quiet /NoRestart 529 | 530 | # Uninstall Work Folders Client 531 | Write-Host "Uninstalling Work Folders Client..." 532 | dism /online /Disable-Feature /FeatureName:WorkFolders-Client /Quiet /NoRestart 533 | 534 | # Install Work Folders Client 535 | # dism /online /Enable-Feature /FeatureName:WorkFolders-Client /Quiet /NoRestart 536 | 537 | # Set Photo Viewer as default for bmp, gif, jpg and png 538 | # Write-Host "Setting Photo Viewer as default for bmp, gif, jpg, png and tif..." 539 | # If (!(Test-Path "HKCR:")) { 540 | # New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null 541 | # } 542 | # ForEach ($type in @("Paint.Picture", "giffile", "jpegfile", "pngfile")) { 543 | # New-Item -Path $("HKCR:\$type\shell\open") -Force | Out-Null 544 | # New-Item -Path $("HKCR:\$type\shell\open\command") | Out-Null 545 | # Set-ItemProperty -Path $("HKCR:\$type\shell\open") -Name "MuiVerb" -Type ExpandString -Value "@%ProgramFiles%\Windows Photo Viewer\photoviewer.dll,-3043" 546 | # 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" 547 | # } 548 | 549 | # Remove or reset default open action for bmp, gif, jpg and png 550 | # If (!(Test-Path "HKCR:")) { 551 | # New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null 552 | # } 553 | # Remove-Item -Path "HKCR:\Paint.Picture\shell\open" -Recurse 554 | # Remove-ItemProperty -Path "HKCR:\giffile\shell\open" -Name "MuiVerb" 555 | # Set-ItemProperty -Path "HKCR:\giffile\shell\open" -Name "CommandId" -Type String -Value "IE.File" 556 | # Set-ItemProperty -Path "HKCR:\giffile\shell\open\command" -Name "(Default)" -Type String -Value "`"$env:SystemDrive\Program Files\Internet Explorer\iexplore.exe`" %1" 557 | # Set-ItemProperty -Path "HKCR:\giffile\shell\open\command" -Name "DelegateExecute" -Type String -Value "{17FE9752-0B5A-4665-84CD-569794602F5C}" 558 | # Remove-Item -Path "HKCR:\jpegfile\shell\open" -Recurse 559 | # Remove-Item -Path "HKCR:\pngfile\shell\open" -Recurse 560 | 561 | # Show Photo Viewer in "Open with..." 562 | # Write-Host "Showing Photo Viewer in `"Open with...`"" 563 | # If (!(Test-Path "HKCR:")) { 564 | # New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null 565 | # } 566 | # New-Item -Path "HKCR:\Applications\photoviewer.dll\shell\open\command" -Force | Out-Null 567 | # New-Item -Path "HKCR:\Applications\photoviewer.dll\shell\open\DropTarget" -Force | Out-Null 568 | # Set-ItemProperty -Path "HKCR:\Applications\photoviewer.dll\shell\open" -Name "MuiVerb" -Type String -Value "@photoviewer.dll,-3043" 569 | # 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" 570 | # Set-ItemProperty -Path "HKCR:\Applications\photoviewer.dll\shell\open\DropTarget" -Name "Clsid" -Type String -Value "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}" 571 | 572 | # Remove Photo Viewer from "Open with..." 573 | # If (!(Test-Path "HKCR:")) { 574 | # New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null 575 | # } 576 | # Remove-Item -Path "HKCR:\Applications\photoviewer.dll\shell\open" -Recurse 577 | 578 | # This script disables unwanted Windows services. If you do not want to disable 579 | # certain services comment out the corresponding lines below. 580 | 581 | $services = @( 582 | "diagnosticshub.standardcollector.service" # Microsoft (R) Diagnostics Hub Standard Collector Service 583 | "DiagTrack" # Diagnostics Tracking Service 584 | "dmwappushservice" # WAP Push Message Routing Service (see known issues) 585 | "lfsvc" # Geolocation Service 586 | "MapsBroker" # Downloaded Maps Manager 587 | "NetTcpPortSharing" # Net.Tcp Port Sharing Service 588 | "RemoteAccess" # Routing and Remote Access 589 | # "RemoteRegistry" # Remote Registry 590 | "SharedAccess" # Internet Connection Sharing (ICS) 591 | "TrkWks" # Distributed Link Tracking Client 592 | # "WbioSrvc" # Windows Biometric Service (required for Fingerprint reader / facial detection) 593 | #"WlanSvc" # WLAN AutoConfig 594 | "WMPNetworkSvc" # Windows Media Player Network Sharing Service 595 | #"wscsvc" # Windows Security Center Service 596 | #"WSearch" # Windows Search 597 | "XblAuthManager" # Xbox Live Auth Manager 598 | "XblGameSave" # Xbox Live Game Save Service 599 | "XboxNetApiSvc" # Xbox Live Networking Service 600 | "ndu" # Windows Network Data Usage Monitor 601 | # Services which cannot be disabled 602 | #"WdNisSvc" 603 | ) 604 | 605 | foreach ($service in $services) { 606 | Write-Output "Trying to disable $service" 607 | Get-Service -Name $service | Set-Service -StartupType Disabled 608 | } 609 | 610 | 611 | # Description: 612 | # This script optimizes Windows updates by disabling automatic download and 613 | # seeding updates to other computers. 614 | # 615 | Import-Module -DisableNameChecking $PSScriptRoot\..\lib\New-FolderForced.psm1 616 | 617 | Write-Output "Disable automatic download and installation of Windows updates" 618 | New-FolderForced -Path "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" 619 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" "NoAutoUpdate" 0 620 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" "AUOptions" 2 621 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" "ScheduledInstallDay" 0 622 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" "ScheduledInstallTime" 3 623 | 624 | Write-Output "Disable seeding of updates to other computers via Group Policies" 625 | New-FolderForced -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" 626 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" "DODownloadMode" 0 627 | 628 | #echo "Disabling automatic driver update" 629 | #sp "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching" "SearchOrderConfig" 0 630 | 631 | $objSID = New-Object System.Security.Principal.SecurityIdentifier "S-1-1-0" 632 | $EveryOne = $objSID.Translate( [System.Security.Principal.NTAccount]).Value 633 | 634 | 635 | Write-Output "Disable 'Updates are available' message" 636 | 637 | takeown /F "$env:WinDIR\System32\MusNotification.exe" 638 | icacls "$env:WinDIR\System32\MusNotification.exe" /deny "$($EveryOne):(X)" 639 | takeown /F "$env:WinDIR\System32\MusNotificationUx.exe" 640 | icacls "$env:WinDIR\System32\MusNotificationUx.exe" /deny "$($EveryOne):(X)" 641 | 642 | 643 | # This script removes unwanted Apps that come with Windows. If you do not want 644 | # to remove certain Apps comment out the corresponding lines below. 645 | 646 | Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1 647 | Import-Module -DisableNameChecking $PSScriptRoot\..\lib\New-FolderForced.psm1 648 | 649 | Write-Output "Elevating privileges for this process" 650 | do {} until (Elevate-Privileges SeTakeOwnershipPrivilege) 651 | 652 | Write-Output "Uninstalling default apps" 653 | $apps = @( 654 | # default Windows 10 apps 655 | "Microsoft.3DBuilder" 656 | "Microsoft.Advertising.Xaml" 657 | "Microsoft.Appconnector" 658 | "Microsoft.BingFinance" 659 | "Microsoft.BingNews" 660 | "Microsoft.BingSports" 661 | "Microsoft.BingTranslator" 662 | "Microsoft.BingWeather" 663 | "Microsoft.FreshPaint" 664 | "Microsoft.GamingServices" 665 | "Microsoft.Microsoft3DViewer" 666 | "Microsoft.WindowsFeedbackHub" 667 | "Microsoft.MicrosoftOfficeHub" 668 | "Microsoft.MixedReality.Portal" 669 | "Microsoft.MicrosoftPowerBIForWindows" 670 | "Microsoft.MicrosoftSolitaireCollection" 671 | #"Microsoft.MicrosoftStickyNotes" 672 | "Microsoft.MinecraftUWP" 673 | "Microsoft.NetworkSpeedTest" 674 | "Microsoft.Office.OneNote" 675 | "Microsoft.People" 676 | "Microsoft.Print3D" 677 | "Microsoft.SkypeApp" 678 | "Microsoft.Wallet" 679 | # "Microsoft.Windows.Photos" 680 | # "Microsoft.WindowsAlarms" 681 | # "Microsoft.WindowsCalculator" 682 | "Microsoft.WindowsCamera" 683 | "microsoft.windowscommunicationsapps" 684 | "Microsoft.WindowsMaps" 685 | "Microsoft.WindowsPhone" 686 | "Microsoft.WindowsSoundRecorder" 687 | #"Microsoft.WindowsStore" # can't be re-installed 688 | "Microsoft.Xbox.TCUI" 689 | "Microsoft.XboxApp" 690 | "Microsoft.XboxGameOverlay" 691 | "Microsoft.XboxGamingOverlay" 692 | "Microsoft.XboxSpeechToTextOverlay" 693 | "Microsoft.YourPhone" 694 | "Microsoft.ZuneMusic" 695 | "Microsoft.ZuneVideo" 696 | "Microsoft.Windows.CloudExperienceHost" 697 | "Microsoft.Windows.ContentDeliveryManager" 698 | "Microsoft.Windows.PeopleExperienceHost" 699 | "Microsoft.XboxGameCallableUI" 700 | "Microsoft.GamingApp" 701 | 702 | # Threshold 2 apps 703 | "Microsoft.CommsPhone" 704 | "Microsoft.ConnectivityStore" 705 | "Microsoft.GetHelp" 706 | "Microsoft.Getstarted" 707 | "Microsoft.Messaging" 708 | "Microsoft.Office.Sway" 709 | "Microsoft.OneConnect" 710 | "Microsoft.WindowsFeedbackHub" 711 | 712 | # Creators Update apps 713 | "Microsoft.Microsoft3DViewer" 714 | #"Microsoft.MSPaint" 715 | 716 | #Redstone apps 717 | "Microsoft.BingFoodAndDrink" 718 | "Microsoft.BingHealthAndFitness" 719 | "Microsoft.BingTravel" 720 | "Microsoft.WindowsReadingList" 721 | 722 | # Redstone 5 apps 723 | "Microsoft.MixedReality.Portal" 724 | #"Microsoft.ScreenSketch" 725 | "Microsoft.XboxGamingOverlay" 726 | "Microsoft.YourPhone" 727 | 728 | # non-Microsoft 729 | "2FE3CB00.PicsArt-PhotoStudio" 730 | "46928bounde.EclipseManager" 731 | "4DF9E0F8.Netflix" 732 | "613EBCEA.PolarrPhotoEditorAcademicEdition" 733 | "6Wunderkinder.Wunderlist" 734 | "7EE7776C.LinkedInforWindows" 735 | "89006A2E.AutodeskSketchBook" 736 | "9E2F88E3.Twitter" 737 | "A278AB0D.DisneyMagicKingdoms" 738 | "A278AB0D.MarchofEmpires" 739 | "ActiproSoftwareLLC.562882FEEB491" # next one is for the Code Writer from Actipro Software LLC 740 | "CAF9E577.Plex" 741 | "ClearChannelRadioDigital.iHeartRadio" 742 | "D52A8D61.FarmVille2CountryEscape" 743 | "D5EA27B7.Duolingo-LearnLanguagesforFree" 744 | "DB6EA5DB.CyberLinkMediaSuiteEssentials" 745 | "DolbyLaboratories.DolbyAccess" 746 | "DolbyLaboratories.DolbyAccess" 747 | "Drawboard.DrawboardPDF" 748 | "Facebook.Facebook" 749 | "Fitbit.FitbitCoach" 750 | "Flipboard.Flipboard" 751 | "GAMELOFTSA.Asphalt8Airborne" 752 | "KeeperSecurityInc.Keeper" 753 | "NORDCURRENT.COOKINGFEVER" 754 | "PandoraMediaInc.29680B314EFC2" 755 | "Playtika.CaesarsSlotsFreeCasino" 756 | "ShazamEntertainmentLtd.Shazam" 757 | "SlingTVLLC.SlingTV" 758 | "SpotifyAB.SpotifyMusic" 759 | "TheNewYorkTimes.NYTCrossword" 760 | "ThumbmunkeysLtd.PhototasticCollage" 761 | "TuneIn.TuneInRadio" 762 | "WinZipComputing.WinZipUniversal" 763 | "XINGAG.XING" 764 | "flaregamesGmbH.RoyalRevolt2" 765 | "king.com.*" 766 | "king.com.BubbleWitch3Saga" 767 | "king.com.CandyCrushSaga" 768 | "king.com.CandyCrushSodaSaga" 769 | "5A894077.McAfeeSecurity" 770 | "Disney.37853FC22B2CE" 771 | "Facebook.InstagramBeta" 772 | "AdobeSystemsIncorporated.AdobeCreativeCloudExpress" 773 | "AmazonVideo.PrimeVideo" 774 | "BytedancePte.Ltd.TikTok" 775 | 776 | # apps which cannot be removed using Remove-AppxPackage 777 | #"Microsoft.BioEnrollment" 778 | #"Microsoft.MicrosoftEdge" 779 | #"Microsoft.Windows.Cortana" 780 | #"Microsoft.WindowsFeedback" 781 | #"Microsoft.XboxGameCallableUI" 782 | #"Microsoft.XboxIdentityProvider" 783 | #"Windows.ContactSupport" 784 | 785 | # apps which other apps depend on 786 | "Microsoft.Advertising.Xaml" 787 | ) 788 | 789 | foreach ($app in $apps) { 790 | Write-Output "Trying to remove $app" 791 | 792 | Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage -AllUsers 793 | 794 | Get-AppXProvisionedPackage -Online | 795 | Where-Object DisplayName -EQ $app | 796 | Remove-AppxProvisionedPackage -Online 797 | } 798 | 799 | # Prevents Apps from re-installing 800 | $cdm = @( 801 | "ContentDeliveryAllowed" 802 | "FeatureManagementEnabled" 803 | "OemPreInstalledAppsEnabled" 804 | "PreInstalledAppsEnabled" 805 | "PreInstalledAppsEverEnabled" 806 | "SilentInstalledAppsEnabled" 807 | "SubscribedContent-314559Enabled" 808 | "SubscribedContent-338387Enabled" 809 | "SubscribedContent-338388Enabled" 810 | "SubscribedContent-338389Enabled" 811 | "SubscribedContent-338393Enabled" 812 | "SubscribedContentEnabled" 813 | "SystemPaneSuggestionsEnabled" 814 | ) 815 | 816 | New-FolderForced -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" 817 | foreach ($key in $cdm) { 818 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" $key 0 819 | } 820 | 821 | New-FolderForced -Path "HKLM:\SOFTWARE\Policies\Microsoft\WindowsStore" 822 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\WindowsStore" "AutoDownload" 2 823 | 824 | # Prevents "Suggested Applications" returning 825 | New-FolderForced -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" 826 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" "DisableWindowsConsumerFeatures" 1 827 | 828 | # Description: 829 | # This script will remove and disable OneDrive integration. 830 | 831 | Import-Module -DisableNameChecking $PSScriptRoot\..\lib\New-FolderForced.psm1 832 | Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1 833 | 834 | Write-Output "Kill OneDrive process" 835 | taskkill.exe /F /IM "OneDrive.exe" 836 | taskkill.exe /F /IM "explorer.exe" 837 | 838 | Write-Output "Remove OneDrive" 839 | if (Test-Path "$env:systemroot\System32\OneDriveSetup.exe") { 840 | & "$env:systemroot\System32\OneDriveSetup.exe" /uninstall 841 | } 842 | if (Test-Path "$env:systemroot\SysWOW64\OneDriveSetup.exe") { 843 | & "$env:systemroot\SysWOW64\OneDriveSetup.exe" /uninstall 844 | } 845 | 846 | Write-Output "Removing OneDrive leftovers" 847 | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:localappdata\Microsoft\OneDrive" 848 | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:programdata\Microsoft OneDrive" 849 | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:systemdrive\OneDriveTemp" 850 | # check if directory is empty before removing: 851 | If ((Get-ChildItem "$env:userprofile\OneDrive" -Recurse | Measure-Object).Count -eq 0) { 852 | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:userprofile\OneDrive" 853 | } 854 | 855 | Write-Output "Disable OneDrive via Group Policies" 856 | New-FolderForced -Path "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive" 857 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive" "DisableFileSyncNGSC" 1 858 | 859 | Write-Output "Remove Onedrive from explorer sidebar" 860 | New-PSDrive -PSProvider "Registry" -Root "HKEY_CLASSES_ROOT" -Name "HKCR" 861 | mkdir -Force "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" 862 | Set-ItemProperty -Path "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" "System.IsPinnedToNameSpaceTree" 0 863 | mkdir -Force "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" 864 | Set-ItemProperty -Path "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" "System.IsPinnedToNameSpaceTree" 0 865 | Remove-PSDrive "HKCR" 866 | 867 | # Thank you Matthew Israelsson 868 | Write-Output "Removing run hook for new users" 869 | reg load "hku\Default" "C:\Users\Default\NTUSER.DAT" 870 | reg delete "HKEY_USERS\Default\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "OneDriveSetup" /f 871 | reg unload "hku\Default" 872 | 873 | Write-Output "Removing startmenu entry" 874 | Remove-Item -Force -ErrorAction SilentlyContinue "$env:userprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk" 875 | 876 | Write-Output "Removing scheduled task" 877 | Get-ScheduledTask -TaskPath '\' -TaskName 'OneDrive*' -ea SilentlyContinue | Unregister-ScheduledTask -Confirm:$false 878 | 879 | Write-Output "Restarting explorer" 880 | Start-Process "explorer.exe" 881 | 882 | Write-Output "Waiting for explorer to complete loading" 883 | Start-Sleep 10 884 | 885 | Write-Output "Removing additional OneDrive leftovers" 886 | foreach ($item in (Get-ChildItem "$env:WinDir\WinSxS\*onedrive*")) { 887 | Takeown-Folder $item.FullName 888 | Remove-Item -Recurse -Force $item.FullName 889 | } 890 | 891 | 892 | 893 | # Remove Password Age Limit (Passwords never expire) # 894 | 895 | net accounts /maxpwage:0 896 | 897 | 898 | # Set Password Age Limit to 60 Days# 899 | 900 | #net accounts /maxpwage:60 901 | 902 | 903 | # This script removes all Start Menu Tiles from the .default user # 904 | 905 | # Set-Content -Path 'C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml' -Value '' 906 | # Add-Content -Path 'C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml' -value ' ' 907 | # Add-Content -Path 'C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml' -value ' ' 908 | # Add-Content -Path 'C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml' -value ' ' 909 | # Add-Content -Path 'C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml' -value ' ' 910 | # Add-Content -Path 'C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml' -value ' ' 911 | # Add-Content -Path 'C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml' -value ' ' 912 | # Add-Content -Path 'C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml' -value ' ' 913 | # Add-Content -Path 'C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml' -value ' ' 914 | # Add-Content -Path 'C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml' -value ' ' 915 | # Add-Content -Path 'C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml' -value ' ' 916 | # Add-Content -Path 'C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml' -value ' ' 917 | # Add-Content -Path 'C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml' -value ' ' 918 | # Add-Content -Path 'C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml' -value ' ' 919 | # Add-Content -Path 'C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml' -value ' ' 920 | # Add-Content -Path 'C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml' -value '' 921 | 922 | # $START_MENU_LAYOUT = @" 923 | # 924 | # 925 | # 926 | # 927 | # 928 | # 929 | # 930 | # 931 | # "@ 932 | 933 | # $layoutFile="C:\Windows\StartMenuLayout.xml" 934 | 935 | #Delete layout file if it already exists 936 | # If(Test-Path $layoutFile) 937 | # { 938 | # Remove-Item $layoutFile 939 | # } 940 | 941 | #Creates the blank layout file 942 | # $START_MENU_LAYOUT | Out-File $layoutFile -Encoding ASCII 943 | 944 | # $regAliases = @("HKLM", "HKCU") 945 | 946 | #Assign the start layout and force it to apply with "LockedStartLayout" at both the machine and user level 947 | # foreach ($regAlias in $regAliases){ 948 | # $basePath = $regAlias + ":\SOFTWARE\Policies\Microsoft\Windows" 949 | # $keyPath = $basePath + "\Explorer" 950 | # IF(!(Test-Path -Path $keyPath)) { 951 | # New-Item -Path $basePath -Name "Explorer" 952 | # } 953 | # Set-ItemProperty -Path $keyPath -Name "LockedStartLayout" -Value 1 954 | # Set-ItemProperty -Path $keyPath -Name "StartLayoutFile" -Value $layoutFile 955 | # } 956 | 957 | #Restart Explorer, open the start menu (necessary to load the new layout), and give it a few seconds to process 958 | # Stop-Process -name explorer 959 | # Start-Sleep -s 5 960 | # $wshell = New-Object -ComObject wscript.shell; $wshell.SendKeys('^{ESCAPE}') 961 | # Start-Sleep -s 5 962 | 963 | #Enable the ability to pin items again by disabling "LockedStartLayout" 964 | # foreach ($regAlias in $regAliases){ 965 | # $basePath = $regAlias + ":\SOFTWARE\Policies\Microsoft\Windows" 966 | # $keyPath = $basePath + "\Explorer" 967 | # Set-ItemProperty -Path $keyPath -Name "LockedStartLayout" -Value 0 968 | # } 969 | 970 | #Restart Explorer and delete the layout file 971 | Stop-Process -name explorer 972 | 973 | # Uncomment the next line to make clean start menu default for all new users 974 | Import-StartLayout -LayoutPath $layoutFile -MountPath $env:SystemDrive\ 975 | 976 | Remove-Item $layoutFile 977 | 978 | 979 | # Prevents SYSPREP from freezing at "Getting Ready" on first boot # 980 | # NOTE, DMWAPPUSHSERVICE is a Keyboard and Ink telemetry service, and potential keylogger. # 981 | # It is recommended to disable this service in new builds, but SYSPREP will freeze/fail # 982 | # if the service is not running. If SYSPREP will be used, add a FirstBootCommand to your # 983 | # build to disable the service. # 984 | 985 | reg delete "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\dmwappushservice" /v "DelayedAutoStart" /f 986 | reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\dmwappushservice" /v "DelayedAutoStart" /t REG_DWORD /d "1" 987 | reg delete "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\dmwappushservice" /v "Start" /f 988 | reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\dmwappushservice" /v "Start" /t REG_DWORD /d "2" 989 | # Add the line below to FirstBootCommand in answer file # 990 | # reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v "disabledmwappushservice" /t REG_SZ /d "sc config dmwappushservice start= disabled" 991 | 992 | 993 | # Disable Privacy Settings Experience # 994 | # Also disables all settings in Privacy Experience # 995 | 996 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OOBE" /v "DisablePrivacyExperience" /f 997 | reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OOBE" /f 998 | reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OOBE" /v "DisablePrivacyExperience" /t REG_DWORD /d "1" /f 999 | reg delete "HKEY_USERS\.DEFAULT\Software\Microsoft\Speech_OneCore\Settings\OnlineSpeechPrivacy" /v "HasAccepted" /f 1000 | reg add "HKEY_USERS\.DEFAULT\Software\Microsoft\Speech_OneCore" /f 1001 | reg add "HKEY_USERS\.DEFAULT\Software\Microsoft\Speech_OneCore\Settings" /f 1002 | reg add "HKEY_USERS\.DEFAULT\Software\Microsoft\Speech_OneCore\Settings\OnlineSpeechPrivacy" /v "HasAccepted" /t REG_DWORD /d "0" /f 1003 | reg delete "HKEY_CURRENT_USER\Software\Microsoft\Speech_OneCore\Settings\OnlineSpeechPrivacy" /v "HasAccepted" /f 1004 | reg add "HKEY_CURRENT_USER\Software\Microsoft\Speech_OneCore" /f 1005 | reg add "HKEY_CURRENT_USER\Software\Microsoft\Speech_OneCore\Settings" /f 1006 | reg add "HKEY_CURRENT_USER\Software\Microsoft\Speech_OneCore\Settings\OnlineSpeechPrivacy" /v "HasAccepted" /t REG_DWORD /d "0" /f 1007 | reg delete "HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" /v "Value" /f 1008 | reg add "HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager" /f 1009 | reg add "HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore" /f 1010 | reg add "HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" /v "Value" /t REG_SZ /d "Deny" /f 1011 | reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" /v "Value" /f 1012 | reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager" /f 1013 | reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore" /f 1014 | reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" /v "Value" /t REG_SZ /d "Deny" /f 1015 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Settings\FindMyDevice" /v "LocationSyncEnabled" /f 1016 | reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Settings\FindMyDevice" /f 1017 | reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Settings\FindMyDevice" /v "LocationSyncEnabled" /t REG_DWORD /d "0" /f 1018 | reg delete "HKEY_USERS\.DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack" /v "ShowedToastAtLevel" /f 1019 | reg add "HKEY_USERS\.DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics" /f 1020 | reg add "HKEY_USERS\.DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack" /f 1021 | reg add "HKEY_USERS\.DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack" /v "ShowedToastAtLevel" /t REG_DWORD /d "1" /f 1022 | reg delete "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack" /v "ShowedToastAtLevel" /f 1023 | reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics" /f 1024 | reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack" /f 1025 | reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack" /v "ShowedToastAtLevel" /t REG_DWORD /d "1" /f 1026 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v "AllowTelemetry" /f 1027 | reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies" /f 1028 | reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /f 1029 | reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v "AllowTelemetry" /t REG_DWORD /d "1" /f 1030 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v "MaxTelemetryAllowed" /f 1031 | reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v "MaxTelemetryAllowed" /t REG_DWORD /d "1" /f 1032 | reg delete "HKEY_USERS\.DEFAULT\Software\Microsoft\Input\TIPC" /v "Enabled" /f 1033 | reg add "HKEY_USERS\.DEFAULT\Software\Microsoft\Input" /f 1034 | reg add "HKEY_USERS\.DEFAULT\Software\Microsoft\Input\TIPC" /f 1035 | reg add "HKEY_USERS\.DEFAULT\Software\Microsoft\Input\TIPC" /v "Enabled" /t REG_DWORD /d "0" /f 1036 | reg delete "HKEY_CURRENT_USER\Software\Microsoft\Input\TIPC" /v "Enabled" /f 1037 | reg add "HKEY_CURRENT_USER\Software\Microsoft\Input" /f 1038 | reg add "HKEY_CURRENT_USER\Software\Microsoft\Input\TIPC" /f 1039 | reg add "HKEY_CURRENT_USER\Software\Microsoft\Input\TIPC" /v "Enabled" /t REG_DWORD /d "0" /f 1040 | reg delete "HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Privacy" /v "TailoredExperiencesWithDiagnosticDataEnabled" /f 1041 | reg add "HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Privacy" /f 1042 | reg add "HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Privacy" /v "TailoredExperiencesWithDiagnosticDataEnabled" /t REG_DWORD /d "0" /f 1043 | reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Privacy" /v "TailoredExperiencesWithDiagnosticDataEnabled" /f 1044 | reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Privacy" /f 1045 | reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Privacy" /v "TailoredExperiencesWithDiagnosticDataEnabled" /t REG_DWORD /d "0" /f 1046 | reg delete "HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v "Enabled" /f 1047 | reg add "HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /f 1048 | reg add "HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v "Enabled" /t REG_DWORD /d "0" /f 1049 | reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v "Enabled" /f 1050 | reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /f 1051 | reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v "Enabled" /t REG_DWORD /d "0" /f 1052 | 1053 | 1054 | # Set Windows to Dark Mode # 1055 | 1056 | reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes" /f 1057 | reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes" /v "AppsUseLightTheme" /t "REG_DWORD" /d "0" /f 1058 | reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes" /v "SystemUsesLightTheme" /t "REG_DWORD" /d "0" /f 1059 | reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes" /f 1060 | reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" /f 1061 | reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" /v "AppsUseLightTheme" /t "REG_DWORD" /d "0" /f 1062 | reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" /v "SystemUsesLightTheme" /t "REG_DWORD" /d "0" /f 1063 | reg add "HKEY_USERS\.DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes" /f 1064 | reg add "HKEY_USERS\.DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" /f 1065 | reg add "HKEY_USERS\.DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" /v "AppsUseLightTheme" /t "REG_DWORD" /d "0" /f 1066 | reg add "HKEY_USERS\.DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" /v "SystemUsesLightTheme" /t "REG_DWORD" /d "0" /f 1067 | 1068 | ########## 1069 | # Restart 1070 | ########## 1071 | Write-Host 1072 | Write-Host "Press any key to restart your system..." -ForegroundColor Black -BackgroundColor White 1073 | $key = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") 1074 | Write-Host "Restarting..." 1075 | Restart-Computer 1076 | --------------------------------------------------------------------------------