├── .gitignore ├── Banner.jpg ├── LICENSE.txt ├── README.md └── W1X Debloat (W10-11).ps1 /.gitignore: -------------------------------------------------------------------------------- 1 | *.psbuild -------------------------------------------------------------------------------- /Banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdminVin/W1X-Debloat/HEAD/Banner.jpg -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | ################################## 2 | # OPEN USE --- NO RESALE LICENSE # 3 | ################################## 4 | 5 | Note: 6 | - This project is intended to be free for all. 7 | 8 | Permitted: 9 | - Use this project for personal or internal business purposes. 10 | - Share it freely without charge. 11 | 12 | Not Permitted: 13 | - Sell, resell, or bundle this code or derivatives for commercial purposes. 14 | - Distribute this project or derivatives for profit. 15 | 16 | Legal: 17 | - This project is provided "as-is" without any warranties. 18 | - The author is not responsible for any damages or losses resulting from its use. 19 | - Use of the name "AdminVin" or associated branding is not permitted without explicit permission. 20 | - © AdminVin 2025. All rights reserved. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # W1X Debloat 2 | ![Banner](https://github.com/AdminVin/W1X-Debloat/raw/main/Banner.jpg) 3 |
4 | 5 | ## What is W1X Debloat? 6 | W1X Debloat is a small PowerShell script that optimizes your Windows 10/11 installation. Originally created for personal use to increase performance, remove bloatware, and more importantly stop Microsoft from spying. 7 |

8 | Friends found it helpful, so here you go! 9 |

10 | 11 | 12 | ## How do I get W1X Debloat? 13 | You can download the script here: 14 | 15 | **Windows 10-11**: https://github.com/AdminVin/W1X-Debloat/raw/main/W1X%20Debloat%20(W10-11).ps1 16 | 17 | ____________________________________ 18 | 19 | 1. Find your OS link above > Right click > Select "Save link as" > Save to your PC 20 | 21 | 2. Click Start > Search for **PowerShell ISE** > Right Click > Run As Administrator 22 | 23 | 3. File > Open > Browse to the file downloaded "W1X Debloat (W10-11).ps1" > Click the "Green Arrow" or press F5 to run. 24 |

25 | 26 | ## Donate 27 | Helped your system? Great! --- Sponsor my next coffee? [PayPal](https://www.paypal.com/donate/?hosted_button_id=EZU78ZANFT24C) 28 | -------------------------------------------------------------------------------- /W1X Debloat (W10-11).ps1: -------------------------------------------------------------------------------- 1 | $SV = "3.10" 2 | <#############################################################################################################################> 3 | <# 4 | [>] Change Log 5 | 2025-12-09 - v3.10 6 | - Added Bing Search and Weather for app removal. 7 | 2025-11-10 - v3.09 8 | - Updated 'Cleanup'Section. 9 | - Added more in depth cleaning of temporary files for all user profiles and system files. 10 | 2025-11-04 - v3.08 11 | - Removed "Home" shortcut in File Explorer, and disabled recommendations. 12 | - Updated PowerShell 7 link to latest version (v7.5.4). 13 | - Added battery percentage in system tray for mobile devices. 14 | - Added "Startup" restore for Settings > Apps > Startup to easier manage startup items. 15 | - Removed log and cleaned up script end output. 16 | 2025-10-21 - v3.07 17 | - OneDrive removal re-added. 18 | - Fresh Windows installation/pre-sign in creates key: HKCU\Software\Microsoft\OneDrive\Installer\BITS\PreSignInSettingsConfigJSON 19 | - Signing into OneDrive removes the registry key. 20 | 2025-10-15 - v3.06 21 | - Added autoruns/autoruns64 check to speed up script. 22 | 2025-09-19 - v3.05 23 | - OneDrive removal commented out, until a more reliable in use/sync detection method can be identified. 24 | 2025-08-07 - v3.04 25 | - Misc Code cleanup/fixes. 26 | 2025-08-03 - v3.03 27 | - Updated Hyper-V tweak, skipping if Docker is installed. 28 | - Updated OneDrive detection and cleaned up output. 29 | 2025-07-07 - v3.02 30 | - Added PowerShell 7 Updater 31 | - Removed 'Ask Co-Pilot' from Right Click Context Menu. 32 | 2025-06-20 - v3.01 33 | - Fixed progress bar bug (being stuck on screen, post operation). 34 | 2025-06-19 - v3.00 35 | - Updated method to detect if OneDrive is signed in and syncing. 36 | - Rewrote all registry modifications, to process faster with a function. 37 | - Updated Metro apps list for removal. 38 | - Metro apps will be removed system wide (all users). 39 | - Updated power plan from "Balanced" to "High Performance" while retaining settings. 40 | - Added Sysinternals "Autoruns" & "Autoruns64" to install. 41 | - Start > Run > autoruns to quick launch. 42 | - Updated Scheduled Tasks & Services method. 43 | - Removed Windows Media Player Sharing service. 44 | - Updated network tweaks: NetDMA; enabled RSS/DCA; set CTCP for optimized throughput and reduced latency. 45 | 2022-07-01 - v1.00 46 | - Initial creation of script. 47 | #> 48 | 49 | 50 | <#############################################################################################################################> 51 | #region 0.0 - Script Variables/Functions 52 | ## Variables 53 | $ErrorActionPreference = "SilentlyContinue" 54 | $ProgressPreference = "SilentlyContinue" # Disable Progress Bars 55 | ## Functions 56 | function Set-Registry { 57 | param ( 58 | [string]$Path, 59 | [string]$Name, 60 | [Parameter(ValueFromPipeline = $true)] 61 | [Object]$Value, 62 | [ValidateSet('String','ExpandString','Binary','DWord','MultiString','QWord')] 63 | [string]$Type, 64 | [ValidateSet('Path','Value')] 65 | [string]$Remove 66 | ) 67 | # Removal Check 68 | if ($Remove -eq 'Path') { 69 | if (Test-Path $Path) { 70 | Remove-Item -Path $Path -Recurse -Force -ErrorAction SilentlyContinue 71 | } 72 | return 73 | } 74 | if ($Remove -eq 'Value') { 75 | if (Test-Path $Path) { 76 | if (Get-ItemProperty -Path $Path -Name $Name -ErrorAction SilentlyContinue) { 77 | Remove-ItemProperty -Path $Path -Name $Name -Force -ErrorAction SilentlyContinue 78 | } 79 | } 80 | return 81 | } 82 | # Path Check 83 | if (-not (Test-Path $Path)) { 84 | $null = New-Item -Path $Path -Force 85 | } 86 | # Item Check 87 | if (-not (Get-ItemProperty -Path $Path -Name $Name -ErrorAction SilentlyContinue)) { 88 | $null = New-ItemProperty -Path $Path -Name $Name -Value $Value -PropertyType $Type -Force 89 | } else { 90 | $null = Set-ItemProperty -Path $Path -Name $Name -Value $Value -Force 91 | } 92 | } 93 | 94 | function Remove-ItemRecursively { 95 | param ( 96 | [string]$Path 97 | ) 98 | 99 | if (Test-Path $Path) { 100 | Get-ChildItem -Path $Path -Recurse -Force -ErrorAction SilentlyContinue | 101 | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue 102 | Remove-Item -Path $Path -Recurse -Force -ErrorAction SilentlyContinue | Out-Null 103 | } 104 | } 105 | 106 | function Test-OneDriveSyncing { 107 | $regPath = "HKCU:\Software\Microsoft\OneDrive\Installer\BITS" 108 | $valueName = "PreSignInSettingsConfigJSON" 109 | 110 | if (Get-ItemProperty -Path $regPath -Name $valueName -ErrorAction SilentlyContinue) { 111 | return $false 112 | } else { 113 | return $true 114 | } 115 | } 116 | 117 | <#############################################################################################################################> 118 | #region 1.0 - Script Status 119 | Write-Host "1.0 Status: Started at $(Get-Date)" -ForegroundColor Green 120 | $Timer = [System.Diagnostics.Stopwatch]::StartNew() 121 | # Free Space - Retrieve Existing Free Space 122 | $FreeSpaceBefore = (Get-PSDrive -Name C).Free / 1GB 123 | Write-Host " - Disk Space Free (before): $("{0:N2} GB" -f $FreeSpaceBefore)" -ForegroundColor Yellow 124 | #endregion 125 | 126 | 127 | <#############################################################################################################################> 128 | #region 2.0 - Diagnostics 129 | Write-Host "`n`n2.0 Diagnostics" -ForegroundColor Green 130 | # Verbose Status Messaging 131 | Set-Registry -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\System" -Name "VerboseStatus" -Type Dword -Value "1" 132 | Write-Host "2.1 Verbose Status Messaging [Enabled]" -ForegroundColor Green 133 | #endregion 134 | 135 | 136 | <#############################################################################################################################> 137 | #region 3.0 Applications 138 | Write-Host "`n`n3.0 Applications" -ForegroundColor Green 139 | 140 | #region Windows 10 - 3.1 Applications - Metro 141 | Write-Host "3.1 Applications - Metro" -ForegroundColor Green 142 | $Apps = @( 143 | # Microsoft - General Bloatware 144 | "Microsoft.3DBuilder*", # 3D Printing App 145 | "Microsoft.549981C3F5F10*", # Cortana Listen Component 146 | "Microsoft.Appconnector*", # App Linking Service 147 | "Microsoft.BingFinance*", # Finance App 148 | "Microsoft.BingFoodAndDrink*", # Food & Drink Guide 149 | "Microsoft.BingHealthAndFitness*", # Health & Fitness App 150 | "Microsoft.BingNews*", # News App 151 | "Microsoft.BingSports*", # Sports Scores App 152 | "Microsoft.BingTranslator*", # Translator App 153 | "Microsoft.BingTravel*", # Travel App 154 | "*Cortana*", # Voice Assistant 155 | "*Clipchamp*", # Video Editor 156 | "Microsoft.CommsPhone*", # Phone Communications 157 | "Microsoft.ConnectivityStore*", # Network Settings Storage 158 | "Microsoft.ECApp", # Ease of Access (OOBE) 159 | "Microsoft.Edge.GameAssist", # Edge Gaming Overlay 160 | "Microsoft.WindowsFeedbackHub*", # Send Feedback to Microsoft 161 | "Microsoft.GetHelp*", # Microsoft Support App 162 | "Microsoft.Getstarted*", # Introductory Guide 163 | "*maps*", # Mapping App 164 | "Microsoft.Messaging*", # SMS Messaging App 165 | "Microsoft.Windows.NarratorQuickStart", # Narrator Tutorial 166 | "Microsoft.Microsoft3DViewer*", # View 3D Models 167 | "Microsoft.MicrosoftOfficeHub*", # Office Promotions 168 | "Microsoft.MicrosoftPowerBIForWindows*", # PowerBI Desktop 169 | "Microsoft.MixedReality.Portal*", # Mixed Reality Setup 170 | "Microsoft.NetworkSpeedTest*", # Network Speed Test 171 | "Microsoft.Office.Sway*", # Sway Presentation Tool 172 | "Microsoft.OneConnect*", # Device Linking 173 | "Microsoft.People*", # Contacts Manager 174 | "Microsoft.PowerAutomateDesktop", # RPA Tool 175 | "Microsoft.Print3D*", # 3D Print Utility 176 | "Microsoft.MicrosoftSolitaireCollection", # Solitaire Game 177 | "Microsoft.SkypeApp*", # Skype Chat App 178 | "Microsoft.Todos*", # To Do List App 179 | "Microsoft.Wallet*", # Payment Wallet 180 | "Microsoft.WidgetsPlatformRuntime", # Widgets Engine 181 | "Microsoft.Whiteboard*", # Virtual Whiteboard 182 | "MicrosoftWindows.Client.WebExperience", # Widgets & Search UI 183 | "Microsoft.Windows.DevHome", # Developer Dashboard 184 | "Microsoft.WindowsMaps*", # Mapping App 185 | "Microsoft.WindowsPhone*", # Phone Companion 186 | "Microsoft.WindowsReadingList*", # Reading List App 187 | "Microsoft.YourPhone*", # Phone Link App 188 | "Microsoft.ZuneMusic", # Groove Music 189 | # Microsoft - Random Bloatware 190 | "*ACGMediaPlayer*", # Media Player 191 | "*ActiproSoftwareLLC*", # Syntax Editor Component 192 | "*AdobePhotoshopExpress*", # Photoshop Express 193 | "*Amazon.com.Amazon*", # Amazon Shopping 194 | "*Asphalt8Airborne*", # Car Racing Game 195 | "*AutodeskSketchBook*", # Drawing App 196 | "*BingSearch*", # Bing Search 197 | "*BingWeather*", # Bing Weather 198 | "*BubbleWitch3Saga*", # Puzzle Game 199 | "*CaesarsSlotsFreeCasino*", # Casino Game 200 | "*CandyCrush*", # Puzzle Game 201 | "*COOKINGFEVER*", # Cooking Game 202 | "*CyberLinkMediaSuiteEssentials*", # Media Suite 203 | "*Disney*", # Disney App 204 | "*DrawboardPDF*", # PDF Editor 205 | "*Duolingo-LearnLanguagesforFree*", # Language Learning 206 | "*EclipseManager*", # Education Tool 207 | "*FarmVille2CountryEscape*", # Farming Game 208 | "*FitbitCoach*", # Fitness Coach 209 | "*Flipboard*", # News Aggregator 210 | "*HiddenCity*", # Hidden Object Game 211 | "*Hulu*", # Streaming App 212 | "*iHeartRadio*", # Radio Streaming 213 | "*Keeper*", # Password Manager 214 | "*Kindle*", # eBook Reader 215 | "*LinkedInforWindows*", # LinkedIn App 216 | "*MarchofEmpires*", # Strategy Game 217 | "*NYTCrossword*", # Crossword Puzzle 218 | "*OneCalendar*", # Calendar App 219 | "*Pandora*", # Music Streaming 220 | "*PhototasticCollage*", # Photo Collage 221 | "*PicsArt-PhotoStudio*", # Photo Editor 222 | "*PolarrPhotoEditorAcademicEdition*", # Photo Editor 223 | "*Prime*", # Amazon Prime 224 | "*RoyalRevolt*", # Action Strategy 225 | "*Shazam*", # Music Identifier 226 | "*Sidia.LiveWallpaper*", # Live Wallpaper 227 | "*SlingTV*", # Live TV App 228 | "*Speed*", # Likely Racing Game 229 | "*Sway*", # Presentation App 230 | "*TuneInRadio*", # Radio Streaming 231 | "*Twitter*", # Twitter Client 232 | "*Viber*", # Messaging App 233 | "*WinZipUniversal*", # Archive Tool 234 | "*Wunderlist*", # Task Manager 235 | "*XING*", # Business Network 236 | "*zune*", # Zune Music/Video 237 | # Samsung - Bloatware 238 | "SAMSUNGELECTRONICSCO.LTD.1412377A9806A*", # Samsung App 239 | "SAMSUNGELECTRONICSCO.LTD.NewVoiceNote*", # Voice Notes 240 | "SAMSUNGELECTRONICSCoLtd.SamsungNotes*", # Samsung Notes 241 | "SAMSUNGELECTRONICSCoLtd.SamsungFlux*", # Unknown Samsung App 242 | "SAMSUNGELECTRONICSCO.LTD.StudioPlus*", # Video Editor 243 | "SAMSUNGELECTRONICSCO.LTD.SamsungWelcome*", # Welcome App 244 | "SAMSUNGELECTRONICSCO.LTD.SamsungSecurity1.2*", # Samsung Security Tool 245 | "SAMSUNGELECTRONICSCO.LTD.SamsungScreenRecording*", # Screen Recorder 246 | "SAMSUNGELECTRONICSCO.LTD.SamsungQuickSearch*", # Search App 247 | "SAMSUNGELECTRONICSCO.LTD.SamsungPCCleaner*", # System Cleaner 248 | "SAMSUNGELECTRONICSCO.LTD.SamsungCloudBluetoothSync*", # Cloud Sync 249 | "SAMSUNGELECTRONICSCO.LTD.PCGallery*", # Photo Viewer 250 | "SAMSUNGELECTRONICSCO.LTD.OnlineSupportSService*", # Online Support 251 | "4AE8B7C2.BOOKING.COMPARTNERAPPSAMSUNGEDITION*" # Booking.com App 252 | "Samsung.Free*", # Free (news & media feed) 253 | "Samsung.Kids*", # Kids (parental control) 254 | "Samsung.Pass*", # Pass (password manager) 255 | "Samsung.GlobalGoals*", # Global Goals (charity) 256 | "Samsung.Internet*", # Internet (browser) 257 | "Samsung.Email*", # Email (mail client) 258 | "Samsung.Members*", # Members (community/support) 259 | "Samsung.Health*", # Health (fitness tracking) 260 | "Samsung.SmartThings*", # SmartThings (smart home) 261 | "Samsung.TVPlus*" # TV Plus (free TV service) 262 | 263 | ) 264 | 265 | foreach ($App in $Apps) { 266 | # Check if installed for any user 267 | $Installed = Get-AppxPackage -AllUsers | Where-Object { $_.Name -like $App } 268 | 269 | if ($Installed) { 270 | Write-Host " - Removing: $App" -ForegroundColor Green 271 | 272 | # Remove for all existing users 273 | foreach ($Install in $Installed) { 274 | Remove-AppxPackage -Package $Install.PackageFullName -ErrorAction SilentlyContinue 275 | } 276 | 277 | # Remove provisioned package (prevents future installs) 278 | $Provisioned = Get-AppxProvisionedPackage -Online | Where-Object { $_.DisplayName -like $App } 279 | foreach ($Prov in $Provisioned) { 280 | Remove-AppxProvisionedPackage -Online -PackageName $Prov.PackageName -ErrorAction SilentlyContinue 281 | } 282 | } 283 | } 284 | 285 | # Outlook (only if Desktop version installed) 286 | if (Test-Path "C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE") { 287 | Remove-AppxProvisionedPackage -Online -PackageName (Get-AppxPackage -AllUsers -Name "Microsoft.OutlookForWindows").PackageName -ErrorAction SilentlyContinue 288 | Get-AppxPackage -AllUsers -Name "Microsoft.OutlookForWindows" | Remove-AppxPackage -ErrorAction SilentlyContinue 289 | Write-Host " - Removed: Outlook (Metro)" -ForegroundColor Green 290 | } 291 | 292 | # REMOVAL - Microsoft Desktop App Installer 293 | #> Silently manages installation and updating of Windows apps, especially those distributed as MSIX or APPX packages. 294 | Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe | Out-Null 295 | # Disable silent installation of third-party apps suggested by Microsoft Store 296 | Set-Registry -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SilentInstalledAppsEnabled" -Type DWord -Value "0" 297 | # Block all content recommendations in Windows (e.g. tips, app suggestions) 298 | Set-Registry -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "ContentDeliveryAllowed" -Type DWord -Value "0" 299 | # Disable personalized and cloud-driven suggestions (e.g. Start menu recommendations) 300 | Set-Registry -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContentEnabled" -Type DWord -Value "0" 301 | # Prevent reinstall of preloaded OEM/factory apps 302 | Set-Registry -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEnabled" -Type DWord -Value "0" 303 | # Mark system as never having allowed OEM preinstalled apps (prevents reinstall triggers) 304 | Set-Registry -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEverEnabled" -Type String -Value "0" 305 | # Disable OEM-specific apps from auto-installing 306 | Set-Registry -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "OEMPreInstalledAppsEnabled" -Type DWord -Value "0" 307 | # Turn off Start menu suggestions (e.g. WhatsApp recommendations under "Recommended") 308 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Start_IrisRecommendations" -Type DWord -Value "0" 309 | 310 | # Restore Progress Bars 311 | $ProgressPreference = "Continue" # Restore Progress Bars 312 | #endregion 313 | 314 | 315 | #region Windows 10/11 - Applications - Desktop 316 | Write-Host "3.2 Applications - Desktop" -ForegroundColor Green 317 | # 3.2.1 Edge 318 | Write-Host "3.2.1 Microsoft Edge" -ForegroundColor Green 319 | #> Services 320 | Get-Service "edgeupdate" | Stop-Service -ErrorAction SilentlyContinue 321 | Get-Service "edgeupdatem" | Stop-Service -ErrorAction SilentlyContinue 322 | Get-Service "edgeupdate" | Set-Service -StartupType Disabled -ErrorAction SilentlyContinue 323 | Get-Service "edgeupdatem" | Set-Service -StartupType Disabled -ErrorAction SilentlyContinue 324 | Set-Registry -Path 'HKLM:\SYSTEM\CurrentControlSet\Services' -Name 'edgeupdate' -Remove Path 325 | Set-Registry -Path 'HKLM:\SYSTEM\CurrentControlSet\Services' -Name 'edgeupdatem' -Remove Path 326 | Write-Host "Microsoft Edge - Auto Update Services [DISABLED]" -ForegroundColor Green 327 | #> Scheduled Tasks 328 | Get-Scheduledtask "*edge*" | Disable-ScheduledTask | Out-Null 329 | Write-Host "Microsoft Edge - Auto Start - Scheduled Task [DISABLED]" -ForegroundColor Green 330 | #> Auto Start 331 | Set-Registry -Path 'HKLM:\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Main' -Name 'AllowPrelaunch' -Value 0 -Type DWord 332 | $paths = @( 333 | "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run", 334 | "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" 335 | ) 336 | foreach ($path in $paths) { 337 | Get-ItemProperty -Path $path | 338 | Get-Member -MemberType NoteProperty | 339 | Where-Object { $_.Name -like '*MicrosoftEdge*' } | 340 | ForEach-Object { 341 | Remove-ItemProperty -Path $path -Name $_.Name -Force 342 | } 343 | } 344 | Write-Host "Microsoft Edge - Auto Start - Startup Entries [DISABLED]" -ForegroundColor Green 345 | #> Tracking 346 | Set-Registry -Path 'HKLM:\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Main' -Name 'DoNotTrack' -Value 1 -Type DWord 347 | Write-Host "Microsoft Edge - Tracking [DISABLED]" -ForegroundColor Green 348 | #> Addons 349 | Get-WmiObject -Query "SELECT * FROM Win32_Product WHERE Name LIKE '%Microsoft Search in Bing%'" | ForEach-Object { $_.Uninstall() > $null 2>&1 } 350 | Write-Host "Microsoft Edge - Bloat Search Addon [REMOVED]" -ForegroundColor Green 351 | # 3.2.2 OneDrive 352 | Write-Host "3.2.2 One Drive" -ForegroundColor Green 353 | if (Test-OneDriveSyncing) { 354 | # DisableFileSync (Enable) 355 | Set-Registry -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive' -Name 'DisableFileSync' -Type DWord -Value 0 356 | # DisableFileSyncNGSC (Enable) 357 | Set-Registry -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive' -Name 'DisableFileSyncNGSC' -Type DWord -Value 0 358 | Write-Host "3.2.2 Microsoft One Drive Removal [Skipped]" -ForegroundColor Yellow 359 | } else { 360 | ## Close OneDrive (if running in background) 361 | taskkill /f /im OneDrive.exe 362 | taskkill /f /im FileCoAuth.exe 363 | ## Official Removal 364 | # x86 365 | $OneDriveSetup32 = "$Env:WinDir\System32\OneDriveSetup.exe" 366 | if (Test-Path $OneDriveSetup32) { Start-Process -FilePath $OneDriveSetup32 -WorkingDirectory "$Env:WinDir\System32" -ArgumentList "/uninstall" | Out-Null } 367 | 368 | # x64 369 | $OneDriveSetup64 = "$Env:WinDir\SysWOW64\OneDriveSetup.exe" 370 | if (Test-Path $OneDriveSetup64) { Start-Process -FilePath $OneDriveSetup64 -WorkingDirectory "$Env:WinDir\SysWOW64" -ArgumentList "/uninstall" | Out-Null } 371 | ## Files Cleanup 372 | # File Explorer - Navigation Bar 373 | Set-Registry -Path 'HKCU:\Software\Classes\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}' -Name '(default)' -Type String -Value 'OneDrive' 374 | Set-Registry -Path 'HKCU:\Software\Classes\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}' -Name 'System.IsPinnedToNameSpaceTree' -Type DWord -Value 0 375 | # AppData / Local 376 | $LocalOneDrive = "$env:LOCALAPPDATA\OneDrive" 377 | if (Test-Path $LocalOneDrive) { Remove-Item -Path $LocalOneDrive -Recurse -Confirm:$false -Force } 378 | # ProgramData 379 | $ProgramDataOneDrive = "$env:PROGRAMDATA\Microsoft OneDrive" 380 | if (Test-Path $ProgramDataOneDrive) { Remove-Item -Path $ProgramDataOneDrive -Recurse -Force | Out-Null } 381 | # Shortcuts 382 | $ShortcutUser = "$env:USERPROFILE\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk" 383 | if (Test-Path $ShortcutUser) { Remove-Item -Path $ShortcutUser -Force | Out-Null } 384 | $ShortcutCommon = "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk" 385 | if (Test-Path $ShortcutCommon) { Remove-Item -Path $ShortcutCommon -Force | Out-Null } 386 | # Program Files 387 | $OneDrivePFx86 = "C:\Program Files (x86)\Microsoft OneDrive" 388 | if (Test-Path $OneDrivePFx86) { Remove-Item -LiteralPath $OneDrivePFx86 -Recurse -Confirm:$false -Force | Out-Null } 389 | $OneDrivePF = "C:\Program Files\Microsoft OneDrive" 390 | if (Test-Path $OneDrivePF) { Remove-Item -LiteralPath $OneDrivePF -Recurse -Confirm:$false -Force | Out-Null } 391 | ## Scheduled Tasks 392 | Get-ScheduledTask "*OneDrive*" | Unregister-ScheduledTask -Confirm:$false 393 | ## Services 394 | $ODUPdaterService = Get-WmiObject -Class Win32_Service -Filter "Name='OneDrive Updater Service'" | Out-Null 395 | $ODUpdaterService = Get-WmiObject -Class Win32_Service -Filter "Name='OneDrive Updater Service'" -ErrorAction SilentlyContinue 396 | if ($ODUpdaterService) { $ODUpdaterService.Delete() | Out-Null } 397 | ## Registry 398 | # Remove Previous Accounts/Sync Options 399 | Set-Registry -Remove Path -Path "HKCU:\Software\Microsoft\OneDrive" 400 | # Remove previously set One Drive settings 401 | Set-Registry -Remove Path -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" 402 | # Remove Right Click Menu Context Options 403 | Set-Registry -Remove Path -Path "HKLM:\SYSTEM\CurrentControlSet\Services\FileSyncHelper" 404 | # Remove from launching on new user profiles 405 | Set-Registry -Remove Value -Path 'HKU:\.DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Run' -Name 'OneDriveSetup' 406 | Set-Registry -Remove Value -Path 'HKU:\.DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce' -Name 'OneDrive' 407 | 408 | # Remove from 'Default' user account 409 | reg load "hku\Default" "C:\Users\Default\NTUSER.DAT" 410 | reg delete "HKEY_USERS\Default\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "OneDriveSetup" /f 411 | reg unload "hku\Default" 412 | ######################################### 413 | ### DISABLE ONE DRIVE FROM BEING USED ### 414 | ######################################### 415 | # DisableFileSync 416 | Set-Registry -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive' -Name 'DisableFileSync' -Type DWord -Value 0 417 | # DisableFileSyncNGSC 418 | Set-Registry -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive' -Name 'DisableFileSyncNGSC' -Type DWord -Value 0 419 | Write-Host "3.2.2 Microsoft One Drive [Removed]" -ForegroundColor Yellow 420 | } 421 | ## 3.2.3 Internet Explorer 422 | Write-Host "3.2.3 Internet Explorer" -ForegroundColor Green 423 | #> Add-Ons 424 | # Send to One Note 425 | Set-Registry -Remove Path -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\Extensions\{2670000A-7350-4f3c-8081-5663EE0C6C49}" 426 | Set-Registry -Remove Path -Path "HKLM:\SOFTWARE\Microsoft\Internet Explorer\Extensions\{2670000A-7350-4f3c-8081-5663EE0C6C49}" 427 | Write-Host "Internet Explorer - Add-On: 'Send to One Note' [REMOVED]" -ForegroundColor Green 428 | # OneNote Linked Notes 429 | Set-Registry -Remove Path -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\Extensions\{789FE86F-6FC4-46A1-9849-EDE0DB0C95CA}" 430 | Set-Registry -Remove Path -Path "HKLM:\SOFTWARE\Microsoft\Internet Explorer\Extensions\{789FE86F-6FC4-46A1-9849-EDE0DB0C95CA}" 431 | Write-Host "Internet Explorer - Add-On: 'OneNote Linked Notes' [REMOVED]" -ForegroundColor Green 432 | # Lync Click to Call 433 | Set-Registry -Remove Value -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\Extensions" -Name "{31D09BA0-12F5-4CCE-BE8A-2923E76605DA}" 434 | Set-Registry -Remove Value -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects" -Name "{31D09BA0-12F5-4CCE-BE8A-2923E76605DA}" 435 | Write-Host "Internet Explorer - Add-On: 'Lync Click to Call' [REMOVED]" -ForegroundColor Green 436 | # IE to Edge Browser Helper Object 437 | Set-Registry -Remove Path -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects\{1FD49718-1D00-4B19-AF5F-070AF6D5D54C}" 438 | $existingTask = Get-ScheduledTask | Where-Object { $_.TaskName -like "Internet Explorer - IEtoEDGE Addon Removal" } 439 | if ($null -eq $existingTask) { 440 | Get-ChildItem -Path "C:\Program Files (x86)\Microsoft\Edge\Application" -Recurse -Filter "BHO" | Remove-Item -Force -Recurse 441 | $action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "Get-ChildItem -Path 'C:\Program Files (x86)\Microsoft\Edge\Application' -Recurse -Filter 'BHO' | Remove-Item -Force -Recurse" 442 | $trigger = New-ScheduledTaskTrigger -AtLogOn 443 | $STPrin = New-ScheduledTaskPrincipal -UserId "SYSTEM" -LogonType ServiceAccount 444 | Register-ScheduledTask -Action $action -Trigger $trigger -TaskName "Internet Explorer - IEtoEDGE Addon Removal" -Description "Removes the Internet Explorer Addon IEtoEDGE. This will permit the use of Internet Explorer." -Principal $STPrin | Out-Null 445 | } 446 | Write-Host "Internet Explorer - Add-On: 'IE to Edge' [REMOVED]" -ForegroundColor Green 447 | 448 | ## 3.2.4 One Note 449 | Write-Host "3.2.4 One Note" -ForegroundColor Green 450 | Remove-Item -LiteralPath "C:\Users\$env:username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Send to OneNote.lnk" -ErrorAction "SilentlyContinue" -Force | Out-Null 451 | Set-Registry -Remove Value -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\StartupFolder" -Name "Send to OneNote.lnk" 452 | Write-Host "OneNote - Startup: 'Send to OneNote' [REMOVED]" -ForegroundColor Green 453 | 454 | ## 3.2.5 Mozilla Firefox 455 | Write-Host "3.2.5 Mozilla Firefox" -ForegroundColor Green 456 | # Scheduled Tasks 457 | Get-ScheduledTask "*Firefox Default*" | Unregister-ScheduledTask -Confirm:$false 458 | Write-Host "Firefox - 'Periodic requests to set as default browser' [DISABLED]" -ForegroundColor Green 459 | 460 | ## 3.2.6 Teams (Home / Small Business) 461 | Write-Host "3.2.6 Teams (Home / Small Business)" -ForegroundColor Green 462 | Set-Registry -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' -Name 'TaskbarMn' -Value 0 -Type DWord 463 | Write-Host "Teams (Home / Small Business) - Taskbar Shortcut [REMOVED]" -ForegroundColor Green 464 | 465 | ## 3.2.7 Teams (Work or School) 466 | Write-Host "3.2.7 Teams (Work or School) - Disabled Auto Start" -ForegroundColor Green 467 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications\MSTeams_8wekyb3d8bbwe" -Name "Disabled" -Value 1 -Type DWord 468 | Set-Registry -Remove Value -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" -Name "Teams" 469 | Set-Registry -Remove Value -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run" -Name "TeamsMachineInstaller" 470 | Set-Registry -Remove Value -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run32" -Name "TeamsMachineUninstallerLocalAppData" 471 | Set-Registry -Remove Value -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run32" -Name "TeamsMachineUninstallerProgramData" 472 | Write-Host "Teams (Work or School) - Auto Start [DISABLED]" -ForegroundColor Green 473 | 474 | ## 3.2.8 Windows Suggestions/Tips/Welcome Experience 475 | Write-Host "3.2.8 Windows Suggestions/Tips/Welcome Experience" -ForegroundColor Green 476 | # Source: https://www.elevenforum.com/t/disable-ads-in-windows-11.8004/ 477 | Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" | 478 | Get-Member -MemberType NoteProperty | 479 | Where-Object { $_.Name -like "SubscribedContent*" } | 480 | ForEach-Object { 481 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name $_.Name -Value 0 482 | } 483 | Write-Host "Windows Suggestions/Tips/Welcome Experience [DISABLED]" -ForegroundColor Green 484 | 485 | ## 3.2.9 Sysinternals Installation 486 | Write-Host "3.2.9 Sysinternals" -ForegroundColor Green 487 | if (-not (Test-Path "C:\Windows\System32\Autoruns.exe")) { 488 | Invoke-WebRequest -Uri "https://live.sysinternals.com/Autoruns.exe" -OutFile "C:\Windows\System32\Autoruns.exe" 489 | Invoke-WebRequest -Uri "https://live.sysinternals.com/Autoruns64.exe" -OutFile "C:\Windows\System32\Autoruns64.exe" 490 | Write-Host "Sysinternals - Autoruns/64 [INSTALLED]" -ForegroundColor Green 491 | Write-Host "Official Website: https://learn.microsoft.com/en-us/sysinternals/" -ForegroundColor Green 492 | } else { 493 | Write-Host "Sysinternals - Autoruns/64 [SKIPPED / ALREADY INSTALLED]" -ForegroundColor Green 494 | } 495 | 496 | ## 3.3.10 Cortana 497 | # Disable 498 | Set-Registry -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortana" -Value 0 -Type DWord 499 | # Disable Lock Screen 500 | Set-Registry -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortanaAboveLock" -Value 0 -Type DWord 501 | # Disable Cloud Search 502 | Set-Registry -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCloudSearch" -Value 0 -Type DWord 503 | # Disable Bing Search Integration 504 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Value 0 -Type DWord 505 | # Disable Cortana Consent UI 506 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "CortanaConsent" -Value 0 -Type DWord 507 | # Disable Web Search Suggestions (taskbar) 508 | Set-Registry -Path "HKCU:\Software\Policies\Microsoft\Windows\Explorer" -Name "DisableSearchBoxSuggestions" -Value 1 -Type DWord 509 | Get-AppxPackage -AllUsers Microsoft.549981C3F5F10 | Remove-AppxPackage | Out-Null 510 | Write-Host "3.3.10 Explorer: Cortana [DISABLED]" -ForegroundColor Green 511 | 512 | ## 3.4.11 Dynamic Lighting 513 | Set-Registry -Path "HKCU:\Software\Microsoft\Lighting" -Name "AmbientLightingEnabled" -Value 0 -Type DWord 514 | Write-Host "3.4.11 Microsoft Dynamic Lighting (RGB Fix) [DISABLED]" -ForegroundColor Green 515 | 516 | ## 3.4.12 Terminal 517 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications\Microsoft.WindowsTerminal_8wekyb3d8bbwe" -Name "Disabled" -Value 1 -Type DWord 518 | Write-Host "3.4.12 Microsoft Terminal - Autostart [DISABLED]" -ForegroundColor Green 519 | #endregion 520 | 521 | #endregion 522 | 523 | 524 | <#############################################################################################################################> 525 | #region 4.0 - Services and Scheduled Tasks 526 | Write-Host "`n`n4.0 Services and Scheduled Tasks" -ForegroundColor Green 527 | ## Services 528 | Write-Host "4.1 Services" -ForegroundColor Green 529 | #> Disable 530 | $services = @( 531 | "MapsBroker", # Bing Downloaded Maps Manager 532 | "autotimesvc", # Celluar Time 533 | "cbdhsvc_*", # Clipboard History Service 534 | "WpcMonSvc", # Parental Controls 535 | "PhoneSvc", # Phone Service 536 | "WPDBusEnum", # Portable Device Enumerator Service 537 | "PcaSvc", # Program Compatibility Assistant Service 538 | "RemoteRegistry", # Remote Registry 539 | "RetailDemo", # Retail Demo 540 | "TapiSrv", # Telephony 541 | "Themes", # Themes 542 | "wisvc", # Windows Insider Service 543 | "icssvc", # Windows Mobile Hotspot Service 544 | "DiagTrack", # Windows Connected User Experiences and Telemetry (InTune related / Does not break sync) 545 | "WerSvc", # Windows Error Reporting Service 546 | "WMPNetworkSvc", # Windows Media Player Network Share 547 | "MixedRealityOpenXRSvc", # Windows Mixed Reality OpenXR Service 548 | "WpnService", # Windows Push Notification System Service 549 | "CscService" # Windows Offline Files 550 | ) 551 | foreach ($service in $services) { 552 | try { 553 | $svc = Get-Service -Name $service -ErrorAction Stop 554 | $serviceName = $svc.DisplayName 555 | Stop-Service -Name $service -ErrorAction SilentlyContinue 556 | Set-Service -Name $service -StartupType Disabled -ErrorAction SilentlyContinue 557 | Write-Host " - Service: $serviceName [DISABLED]" -ForegroundColor Green 558 | } catch { 559 | Write-Host " - Service: $service [NOT FOUND]" -ForegroundColor Yellow 560 | } 561 | } 562 | #> Disable - Superfetch/Prefetch Disable (if running SSD) 563 | $disk = Get-PhysicalDisk | Where-Object { $_.DeviceID -eq (Get-Disk -Number (Get-Partition -DriveLetter C).DiskNumber).Number } 564 | if ($disk.MediaType -eq 'SSD') { 565 | Stop-Service -Name SysMain -Force 566 | Set-Service -Name SysMain -StartupType Disabled 567 | Write-Host " - Service: Superfetch/Prefetch [DISABLED]" -ForegroundColor Green 568 | } else { 569 | Write-Host " - Service: Superfetch/Prefetch [UNMODIFIED (HDD Detected)]" -ForegroundColor Green 570 | } 571 | #> Disable - DiagTrack/dmwappushservice 572 | $intuneInstalled = Get-Service -Name "IntuneManagementExtension" -ErrorAction SilentlyContinue 573 | if (!($intuneInstalled)) { 574 | # DiagTrack (Telemetry + Timeline) 575 | Stop-Service DiagTrack -Force -ErrorAction SilentlyContinue 576 | Set-Service DiagTrack -StartupType Disabled 577 | Write-Host " - Service: DiagTrack (Telemetry + Timeline) [DISABLED]" -ForegroundColor Green 578 | 579 | # dmwappushservice (Push-based Clipboard Sync) 580 | Stop-Service dmwappushservice -Force -ErrorAction SilentlyContinue 581 | Set-Service dmwappushservice -StartupType Disabled 582 | Write-Host " - Service: dmwappushservice (Push-based Clipboard Sync) [DISABLED]" -ForegroundColor Green 583 | } 584 | #> Delete - Windows Media Player Network Share 585 | if (Get-Service -Name 'WMPNetworkSvc' -ErrorAction SilentlyContinue) { 586 | sc.exe delete WMPNetworkSvc 587 | Write-Host " - Service: Windows Media Player Network Share [DELETED]" -Foregroundcolor Green 588 | } 589 | #> Manual - Bluetooth 590 | $services = @( 591 | "BTAGService", # Bluetooth 592 | "bthserv" # Bluetooth 593 | ) 594 | foreach ($service in $services) { 595 | $svc = Get-Service -Name $service -ErrorAction SilentlyContinue 596 | if ($null -ne $svc) { 597 | $svc | Stop-Service -ErrorAction SilentlyContinue 598 | $svc | Set-Service -StartupType Manual -ErrorAction SilentlyContinue 599 | Write-Host " - Service: $($svc.DisplayName) [Set to Manual]" -ForegroundColor Green 600 | } 601 | } 602 | 603 | 604 | ## Scheduled Tasks 605 | Write-Host "4.2 Scheduled Tasks" -ForegroundColor Green 606 | # Tasks - Intune Related 607 | $removedCount = 0 608 | if (!($intuneInstalled)) { 609 | $Tasks = @( 610 | "\Microsoft\Windows\Application Experience\ProgramDataUpdater", 611 | "\Microsoft\Windows\Application Experience\StartupAppTask", 612 | "\Microsoft\Windows\Autochk\Proxy", 613 | "\Microsoft\Windows\Customer Experience Improvement Program\BthSQM", 614 | "\Microsoft\Windows\Customer Experience Improvement Program\Consolidator", 615 | "\Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask", 616 | "\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip", 617 | "\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector", 618 | "\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticResolver" 619 | ) 620 | 621 | foreach ($task in $Tasks) { 622 | try { 623 | $taskName = ($task.Split('\')[-1]) 624 | $taskPath = ($task -replace "\\$taskName$", "") 625 | Disable-ScheduledTask -TaskName $taskName -TaskPath $taskPath -ErrorAction SilentlyContinue | Out-Null 626 | $removedCount++ 627 | Write-Host " - Task: $task [DISABLED]" -ForegroundColor Green 628 | } catch { 629 | Write-Host " - Task: $task [NOT FOUND]" -ForegroundColor Yellow 630 | } 631 | } 632 | } 633 | # Tasks - General/All Systems 634 | $taskData = @( 635 | @{ TaskName = "Proxy"; TaskPath = "\Microsoft\Windows\Autochk\"; DisplayName = "Proxy Task" }, 636 | @{ TaskName = "SmartScreenSpecific"; TaskPath = "\Microsoft\Windows\AppID\"; DisplayName = "SmartScreen Specific Task" }, 637 | @{ TaskName = "Microsoft Compatibility Appraiser"; TaskPath = "\Microsoft\Windows\Application Experience\"; DisplayName = "Microsoft Compatibility Appraiser Task" }, 638 | @{ TaskName = "ProgramDataUpdater"; TaskPath = "\Microsoft\Windows\Application Experience\"; DisplayName = "Program Data Updater Task" }, 639 | @{ TaskName = "AitAgent"; TaskPath = "\Microsoft\Windows\Application Experience\"; DisplayName = "Application Experience AIT Agent" }, 640 | @{ TaskName = "Consolidator"; TaskPath = "\Microsoft\Windows\Customer Experience Improvement Program\"; DisplayName = "Consolidator Task" }, 641 | @{ TaskName = "KernelCeipTask"; TaskPath = "\Microsoft\Windows\Customer Experience Improvement Program\"; DisplayName = "Kernel CEIP Task" }, 642 | @{ TaskName = "UsbCeip"; TaskPath = "\Microsoft\Windows\Customer Experience Improvement Program\"; DisplayName = "USB CEIP Task" }, 643 | @{ TaskName = "Microsoft-Windows-DiskDiagnosticDataCollector"; TaskPath = "\Microsoft\Windows\DiskDiagnostic\"; DisplayName = "Disk Diagnostic Data Collector Task" }, 644 | @{ TaskName = "Microsoft-Windows-DiskDiagnosticResolver"; TaskPath = "\Microsoft\Windows\DiskDiagnostic\"; DisplayName = "Disk Diagnostic Resolver Task" }, 645 | @{ TaskName = "GatherNetworkInfo"; TaskPath = "\Microsoft\Windows\NetTrace\"; DisplayName = "Gather Network Info Task" }, 646 | @{ TaskName = "QueueReporting"; TaskPath = "\Microsoft\Windows\Windows Error Reporting\"; DisplayName = "Queue Reporting Task" }, 647 | @{ TaskName = "UpdateLibrary"; TaskPath = "\Microsoft\Windows\Windows Media Sharing\"; DisplayName = "Update Library Task" }, 648 | @{ TaskName = "WinSAT"; TaskPath = "\Microsoft\Windows\Maintenance\"; DisplayName = "Windows System Assessment Tool" }, 649 | @{ TaskName = "MapsToastTask"; TaskPath = "\Microsoft\Windows\Maps\"; DisplayName = "Maps Toast Task" }, 650 | @{ TaskName = "MapsUpdateTask"; TaskPath = "\Microsoft\Windows\Maps\"; DisplayName = "Maps Update Task" }, 651 | @{ TaskName = "AnalyzeSystem"; TaskPath = "\Microsoft\Windows\Power Efficiency Diagnostics\"; DisplayName = "Power Efficiency Diagnostics" } 652 | ) 653 | foreach ($taskInfo in $taskData) { 654 | $taskName = $taskInfo.TaskName 655 | $taskPath = $taskInfo.TaskPath 656 | $displayName = $taskInfo.DisplayName 657 | try { 658 | if (Get-ScheduledTask -TaskName $taskName -TaskPath $taskPath -ErrorAction SilentlyContinue) { 659 | Unregister-ScheduledTask -TaskName $taskName -TaskPath $taskPath -Confirm:$false -ErrorAction Stop | Out-Null 660 | Write-Host " - Task: '$displayName' [REMOVED]" -ForegroundColor Green 661 | $removedCount++ 662 | } 663 | } catch { 664 | Write-Host " - Task: '$displayName' [FAILED or NOT FOUND]" -ForegroundColor Yellow 665 | } 666 | } 667 | if ($removedCount -eq 0) { 668 | Write-Host " - Task: All removed previously!" -ForegroundColor Yellow 669 | } 670 | #endregion 671 | 672 | <#############################################################################################################################> 673 | #region 5.0 - Quality of Life 674 | Write-Host "`n`n5.0 Quality of Life" -ForegroundColor Green 675 | 676 | <###################################### EXPLORER TWEAKS (Start) ######################################> 677 | # Restore 'Windows 10' Right Click Context Menu 678 | if((Test-Path -LiteralPath "HKCU:\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32") -ne $true) {New-Item "HKCU:\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" -Force | Out-Null} 679 | Set-Registry -Path "HKCU:\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" -Name "(default)" -Type String -Value "" 680 | Write-Host "Explorer: Windows 10 - Right Click Context Menu [RESTORED]" -ForegroundColor Green 681 | 682 | # Right Click Context Menu - Add "Open with Powershell 5.1 (Admin)" 683 | # Remove old variant registry path (prevent duplicate entry) 684 | Set-Registry -Remove Path -Path "HKLM:\SOFTWARE\Classes\Directory\Background\shell\PowerShellAsAdmin" 685 | Set-Registry -Remove Path -Path "HKLM:\SOFTWARE\Classes\Directory\shell\PowerShellAsAdmin" 686 | Set-Registry -Remove Path -Path "HKLM:\SOFTWARE\Classes\Drive\shell\PowerShellAsAdmin" 687 | Set-Registry -Remove Path -Path "HKLM:\SOFTWARE\Classes\LibraryFolder\Background\shell\PowerShellAsAdmin" 688 | # Add 689 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Directory\Background\shell\PowerShell5AsAdmin' -Name '(default)' -Value 'Open with PowerShell 5 (Admin)' -Type String 690 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Directory\Background\shell\PowerShell5AsAdmin' -Name 'Extended' -Remove Value 691 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Directory\Background\shell\PowerShell5AsAdmin' -Name 'HasLUAShield' -Value '' -Type String 692 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Directory\Background\shell\PowerShell5AsAdmin' -Name 'Icon' -Value 'powershell.exe' -Type String 693 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Directory\Background\shell\PowerShell5AsAdmin\command' -Name '(default)' -Value 'powershell -WindowStyle Hidden -NoProfile -Command "Start-Process -Verb RunAs powershell.exe -ArgumentList \"-NoExit -Command Push-Location \\\"\"%V/\\\"\"\"' -Type String 694 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Directory\shell\PowerShell5AsAdmin' -Name '(default)' -Value 'Open with PowerShell 5 (Admin)' -Type String 695 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Directory\shell\PowerShell5AsAdmin' -Name 'Extended' -Remove Value 696 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Directory\shell\PowerShell5AsAdmin' -Name 'HasLUAShield' -Value '' -Type String 697 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Directory\shell\PowerShell5AsAdmin' -Name 'Icon' -Value 'powershell.exe' -Type String 698 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Directory\shell\PowerShell5AsAdmin\command' -Name '(default)' -Value 'powershell -WindowStyle Hidden -NoProfile -Command "Start-Process -Verb RunAs powershell.exe -ArgumentList \"-NoExit -Command Push-Location \\\"\"%V/\\\"\"\"' -Type String 699 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Drive\shell\PowerShell5AsAdmin' -Name '(default)' -Value 'Open with PowerShell 5 (Admin)' -Type String 700 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Drive\shell\PowerShell5AsAdmin' -Name 'Extended' -Remove Value 701 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Drive\shell\PowerShell5AsAdmin' -Name 'HasLUAShield' -Value '' -Type String 702 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Drive\shell\PowerShell5AsAdmin' -Name 'Icon' -Value 'powershell.exe' -Type String 703 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Drive\shell\PowerShell5AsAdmin\command' -Name '(default)' -Value 'powershell -WindowStyle Hidden -NoProfile -Command "Start-Process -Verb RunAs powershell.exe -ArgumentList \"-NoExit -Command Push-Location \\\"\"%V/\\\"\"\"' -Type String 704 | Set-Registry -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' -Name 'EnableLinkedConnections' -Value 1 -Type DWord 705 | Write-Host "Explorer: 'Open with PowerShell 5.1 (Admin)' - Right Click Context Menu [ADDED]" -ForegroundColor Green 706 | 707 | # Right Click Context Menu - Add "Open with Powershell 7 (Admin)" 708 | $PS7InstallerURL = "https://github.com/PowerShell/PowerShell/releases/download/v7.5.4/PowerShell-7.5.4-win-x64.msi" 709 | 710 | # Install 711 | if (-not (Test-Path "C:\Program Files\PowerShell\7\pwsh.exe")) { 712 | Write-Host "Explorer: PowerShell 7 [DOWNLOADING]" -ForegroundColor Yellow 713 | New-Item -Path "C:\PSTemp" -ItemType Directory | Out-Null 714 | Invoke-WebRequest -Uri $PS7InstallerURL -OutFile "C:\PSTemp\PowerShell-7.msi" 715 | Start-Process -FilePath msiexec -ArgumentList "/i `"C:\PSTemp\PowerShell-7.msi`" /qn" -Wait 716 | Remove-Item -Path "C:\PSTemp" -Recurse -Force | Out-Null 717 | Write-Host "Explorer: PowerShell 7 [INSTALLED]" -ForegroundColor Green 718 | } 719 | 720 | # Add 721 | Set-Registry -Remove Path -Path "HKLM:\SOFTWARE\Classes\LibraryFolder\Background\shell\PowerShell7AsAdmin" 722 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Directory\Background\shell\PowerShell7AsAdmin' -Name '(default)' -Value 'Open with PowerShell 7 (Admin)' 723 | Set-Registry -Remove Value -Path 'HKLM:\SOFTWARE\Classes\Directory\Background\shell\PowerShell7AsAdmin' -Name 'Extended' 724 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Directory\Background\shell\PowerShell7AsAdmin' -Name 'HasLUAShield' -Value '' 725 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Directory\Background\shell\PowerShell7AsAdmin' -Name 'Icon' -Value 'powershell.exe' 726 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Directory\Background\shell\PowerShell7AsAdmin\command' -Name '(default)' -Value 'powershell -WindowStyle Hidden -NoProfile -Command "Start-Process -Verb RunAs pwsh.exe -ArgumentList \"-NoExit -Command Push-Location \\\"\"%V/\\\"\"\""' 727 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Directory\shell\PowerShell7AsAdmin' -Name '(default)' -Value 'Open with PowerShell 7 (Admin)' 728 | Set-Registry -Remove Value -Path 'HKLM:\SOFTWARE\Classes\Directory\shell\PowerShell7AsAdmin' -Name 'Extended' 729 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Directory\shell\PowerShell7AsAdmin' -Name 'HasLUAShield' -Value '' 730 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Directory\shell\PowerShell7AsAdmin' -Name 'Icon' -Value 'pwsh.exe' 731 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Directory\shell\PowerShell7AsAdmin\command' -Name '(default)' -Value 'powershell -WindowStyle Hidden -NoProfile -Command "Start-Process -Verb RunAs pwsh.exe -ArgumentList \"-NoExit -Command Push-Location \\\"\"%V/\\\"\"\""' 732 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Drive\shell\PowerShell7AsAdmin' -Name '(default)' -Value 'Open with PowerShell 7 (Admin)' 733 | Set-Registry -Remove Value -Path 'HKLM:\SOFTWARE\Classes\Drive\shell\PowerShell7AsAdmin' -Name 'Extended' 734 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Drive\shell\PowerShell7AsAdmin' -Name 'HasLUAShield' -Value '' 735 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Drive\shell\PowerShell7AsAdmin' -Name 'Icon' -Value 'pwsh.exe' 736 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Drive\shell\PowerShell7AsAdmin\command' -Name '(default)' -Value 'powershell -WindowStyle Hidden -NoProfile -Command "Start-Process -Verb RunAs pwsh.exe -ArgumentList \"-NoExit -Command Push-Location \\\"\"%V/\\\"\"\""' 737 | Write-Host "Explorer: 'Open with PowerShell 7 (Admin)' - Right Click Context Menu [ADDED]" -ForegroundColor Green 738 | 739 | # Right Click Context Menu - Add "Run as Different User" 740 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\exefile\shell\runasuser' -Name 'Extended' -Value $null -Type String 741 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\exefile\shell\runasuser' -Name 'Icon' -Value 'imageres.dll,-5203' -Type String 742 | Write-Host "Explorer: 'Run as different user' - Right Click Context Menu [ADDED]" -ForegroundColor Green 743 | 744 | # Right Click Context Menu - Add "Copy as Path" 745 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Allfilesystemobjects\shell\windows.copyaspath' -Name '(default)' -Value 'Copy &as path' -Type String 746 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Allfilesystemobjects\shell\windows.copyaspath' -Name 'InvokeCommandOnSelection' -Value 1 -Type DWord 747 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Allfilesystemobjects\shell\windows.copyaspath' -Name 'VerbHandler' -Value '{f3d06e7c-1e45-4a26-847e-f9fcdee59be0}' -Type String 748 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Allfilesystemobjects\shell\windows.copyaspath' -Name 'VerbName' -Value 'copyaspath' -Type String 749 | Set-Registry -Path 'HKLM:\SOFTWARE\Classes\Allfilesystemobjects\shell\windows.copyaspath' -Name 'Icon' -Value 'imageres.dll,-5302' -Type String 750 | Write-Host "Explorer: 'Copy as Path' - Right Click Context Menu [ADDED]" -ForegroundColor Green 751 | 752 | # Right Click Context Menu - Remove "Add to Favorites" (2025-06-12 - Needs to stay as New-ItemProperty) 753 | if((Test-Path -LiteralPath "HKLM:\SOFTWARE\Classes\*\shell\pintohomefile") -ne $true) {New-Item "HKLM:\SOFTWARE\Classes\*\shell\pintohomefile" -Force | Out-Null} 754 | New-ItemProperty -LiteralPath 'HKLM:\SOFTWARE\Classes\*\shell\pintohomefile' -Name 'ProgrammaticAccessOnly' -Value "" -PropertyType String -Force | Out-Null 755 | Write-Host "Explorer: 'Add to Favorites' - Right Click Context Menu [REMOVED]" -ForegroundColor Green 756 | 757 | # Right Click Context Menu - Add "Convert to JPG" 758 | $key = "HKLM:\SOFTWARE\Classes\SystemFileAssociations\.jfif\shell\ConvertToJPG" 759 | if (!(Test-Path $key)) { 760 | $value = "Convert to JPG" 761 | $command = "powershell.exe Rename-Item -Path '%1' -NewName ('%1.jpg')" 762 | New-Item -Path $key -Force | Out-Null 763 | Set-ItemProperty -Path $key -Name "(Default)" -Value $value 764 | New-ItemProperty -LiteralPath $key -Name 'Icon' -Value 'shell32.dll,-16805' -PropertyType String -Force | Out-Null 765 | $commandKey = Join-Path $key "command" 766 | New-Item -Path $commandKey -Force | Out-Null 767 | Set-ItemProperty -Path $commandKey -Name "(Default)" -Value $command 768 | Write-Host "Explorer: File Convert .JFIF to .JPG - Right Click Context Menu [ADDED]" -ForegroundColor Green 769 | } ELSE { 770 | Write-Host "Explorer: File Convert .JFIF to .JPG - Right Click Context Menu [ADDED (Previously)]" -ForegroundColor Green 771 | } 772 | 773 | # Right Click Context Menu "Add Watermark" 774 | $scriptDir = "C:\ProgramData\AV\Watermark" 775 | if (-not (Test-Path -Path $scriptDir)) { 776 | New-Item -Path $scriptDir -ItemType Directory -Force 777 | } 778 | 779 | $scriptContent = @' 780 | Add-Type -AssemblyName System.Drawing 781 | 782 | function Resize-AndAddWatermark { 783 | param ( 784 | [string]$imagePath 785 | ) 786 | 787 | # Load image 788 | $image = [System.Drawing.Image]::FromFile($imagePath) 789 | 790 | # Resize image 791 | $newWidth = 800 792 | $newHeight = 600 793 | $resizedImage = New-Object System.Drawing.Bitmap $image, $newWidth, $newHeight 794 | 795 | # Create graphics object 796 | $graphics = [System.Drawing.Graphics]::FromImage($resizedImage) 797 | $graphics.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::AntiAlias 798 | $graphics.Clear([System.Drawing.Color]::White) 799 | 800 | # Draw the image onto the resized image 801 | $graphics.DrawImage($image, 0, 0, $newWidth, $newHeight) 802 | 803 | # Set watermark text properties 804 | $font = New-Object System.Drawing.Font("Arial", 120, [System.Drawing.FontStyle]::Bold) 805 | $brush = New-Object System.Drawing.SolidBrush([System.Drawing.Color]::FromArgb(50, 255, 255, 255)) # Semi-transparent white 806 | 807 | # Draw main centered watermark text 808 | $mainText = "PREVIEW" 809 | $textWidth = $graphics.MeasureString($mainText, $font).Width 810 | $textHeight = $graphics.MeasureString($mainText, $font).Height 811 | $centerX = ($newWidth - $textWidth) / 2 812 | $centerY = ($newHeight - $textHeight) / 2 813 | $graphics.DrawString($mainText, $font, $brush, $centerX, $centerY) 814 | 815 | # Tiled and distorted watermark text 816 | $tileFont = New-Object System.Drawing.Font("Arial", 50, [System.Drawing.FontStyle]::Bold) 817 | $tileBrush = New-Object System.Drawing.SolidBrush([System.Drawing.Color]::FromArgb(30, 255, 255, 255)) # Lighter transparency 818 | 819 | $tileWidth = 200 820 | $tileHeight = 100 821 | for ($y = 0; $y -lt $newHeight; $y += $tileHeight) { 822 | for ($x = 0; $x -lt $newWidth; $x += $tileWidth) { 823 | # Apply random rotation and scaling 824 | $angle = (Get-Random -Minimum -15 -Maximum 15) 825 | $scale = (Get-Random -Minimum 0.8 -Maximum 1.2) 826 | 827 | # Create a transformation matrix 828 | $matrix = New-Object System.Drawing.Drawing2D.Matrix 829 | $matrix.RotateAt($angle, [System.Drawing.PointF]::new($x + $tileWidth / 2, $y + $tileHeight / 2)) 830 | $matrix.Scale($scale, $scale) 831 | 832 | # Apply the transformation 833 | $graphics.Transform = $matrix 834 | $graphics.DrawString($mainText, $tileFont, $tileBrush, $x, $y) 835 | $graphics.ResetTransform() 836 | } 837 | } 838 | 839 | # Save the output image 840 | $directory = [System.IO.Path]::GetDirectoryName($imagePath) 841 | $fileName = [System.IO.Path]::GetFileNameWithoutExtension($imagePath) 842 | $outputPath = Join-Path -Path $directory -ChildPath ("$fileName`_resized.jpg") 843 | 844 | $counter = 1 845 | while (Test-Path $outputPath) { 846 | $outputPath = Join-Path -Path $directory -ChildPath ("$fileName`_resized($counter).jpg") 847 | $counter++ 848 | } 849 | 850 | $resizedImage.Save($outputPath, [System.Drawing.Imaging.ImageFormat]::Jpeg) 851 | 852 | # Clean up 853 | $graphics.Dispose() 854 | $resizedImage.Dispose() 855 | $image.Dispose() 856 | } 857 | 858 | Resize-AndAddWatermark -imagePath $args[0] 859 | '@ 860 | 861 | $scriptPath = Join-Path -Path $scriptDir -ChildPath "ResizeAndAddWatermark.ps1" 862 | $scriptContent | Out-File -FilePath $scriptPath -Force 863 | 864 | $regPathJPG = "HKCU:\Software\Classes\SystemFileAssociations\.jpg\shell\AddWatermark" 865 | $regPathPNG = "HKCU:\Software\Classes\SystemFileAssociations\.png\shell\AddWatermark" 866 | 867 | $regKeys = @($regPathJPG, $regPathPNG) 868 | 869 | foreach ($key in $regKeys) { 870 | if (-not (Test-Path $key)) { 871 | New-Item -Path $key -Force 872 | } 873 | 874 | Set-ItemProperty -Path $key -Name "(Default)" -Value "Add Watermark" 875 | 876 | $commandKeyPath = "$key\command" 877 | if (-not (Test-Path $commandKeyPath)) { 878 | New-Item -Path $commandKeyPath -Force 879 | } 880 | 881 | Set-ItemProperty -Path $commandKeyPath -Name "(Default)" -Value "powershell.exe -ExecutionPolicy Bypass -File `"$scriptPath`" `"%1`"" 882 | Set-ItemProperty -Path $key -Name "Icon" -Value "shell32.dll,43" 883 | } 884 | Write-Host "Explorer: .JPG/.PNG 'Add Watermark' - Right Click Context Menu [ADDED]" -ForegroundColor Green 885 | 886 | Set-Registry -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' -Name 'LaunchTo' -Value 1 -Type DWord 887 | Write-Host "Explorer: Explorer defaults to 'This PC' instead of 'Home/Most Recent'" -ForegroundColor Green 888 | 889 | # Source: https://www.elevenforum.com/t/add-or-remove-gallery-in-file-explorer-navigation-pane-in-windows-11.14178/ 890 | Set-Registry -Path "HKCU:\Software\Classes\CLSID\{e88865ea-0e1c-4e20-9aa6-edcd0212c87c}" -Name "System.IsPinnedToNameSpaceTree" -Value 0 -Type DWord 891 | Write-Host "Explorer: 'Gallery' Shorcut [REMOVED]" -ForegroundColor Green 892 | 893 | # Source: https://www.elevenforum.com/t/add-or-remove-home-in-navigation-pane-of-file-explorer-in-windows-11.2449/#Two 894 | Set-Registry -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{f874310e-b6b7-47dc-bc84-b9e6b38f5903}" -Name "(default)" -Value "CLSID_MSGraphHomeFolder" -Type String 895 | Set-Registry -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{f874310e-b6b7-47dc-bc84-b9e6b38f5903}" -Name "HiddenByDefault" -Value 1 -Type DWord 896 | Write-Host "Explorer: 'Home' Shortcut [REMOVED]'" -ForegroundColor Green 897 | 898 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "ShowRecommendations" -Value 0 -Type DWord 899 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "ShowCloudFilesInQuickAccess" -Value 0 -Type DWord 900 | Write-Host "Explorer: Windows Explorer Recommendations [DISABLED]" -ForegroundColor Green 901 | 902 | <# [>] 2025/11/3 - Note: Windows 25H2 still tracks recent files with this off; no performance gain. 903 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "ShowRecent" -Value 1 -Type DWord 904 | Write-Host "Explorer: 'Recent Files' in Quick Access [DISABLED]" -ForegroundColor Yellow 905 | 906 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Start_TrackDocs" -Value 1 -Type DWord 907 | Write-Host "Explorer: Disabled Recent Files/Folders in Start Menu and Explorer [Skipped]" -ForegroundColor Yellow 908 | #> 909 | 910 | Set-Registry -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" -Name "ShowDriveLettersFirst" -Type DWord -Value 4 911 | Write-Host "Explorer: Drive letters PRE drive label [Example: '(C:) Windows vs. Windows (C:)]'" -ForegroundColor Green 912 | 913 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Value 0 -Type DWord 914 | Write-Host "Explorer: Display of Known File Extensions [ENABLED]" -ForegroundColor Green 915 | 916 | # Windows 'Get most of out this device' Suggestions 917 | New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\UserProfileEngagement" -Force | Out-Null 918 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\UserProfileEngagement" -Name "ScoobeSystemSettingEnabled" -Value 0 -Type DWord 919 | Write-Host "Explorer: 'Getting most out of this device' [DISABLED]" -ForegroundColor Green 920 | 921 | # Source: https://www.elevenforum.com/t/enable-or-disable-store-activity-history-on-device-in-windows-11.7812/ #Note: Potentially needed for InTune 922 | Set-Registry -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\System' -Name 'PublishUserActivities' -Value 0 -Type DWord 923 | Write-Host "Explorer: Activity Log [DISABLED]" -ForegroundColor Green 924 | 925 | # Tailored Experience 926 | Set-Registry -Path "HKCU:\Software\Policies\Microsoft\Windows\CloudContent" -Name "DisableTailoredExperiencesWithDiagnosticData" -Value 1 -Type DWord 927 | Write-Host "Explorer: Tailored Experience [DISABLED]" -ForegroundColor Green 928 | 929 | # Personalized Ads 930 | New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" -Force | Out-Null 931 | Set-Registry -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" -Name "DisabledByGroupPolicy" -Value 1 -Type DWord 932 | Write-Host "Explorer: Personalized Ads [DISABLED]" -ForegroundColor Green 933 | 934 | # Feedback - Source: https://www.makeuseof.com/windows-disable-feedback-notifications/ 935 | Set-Registry -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "DoNotShowFeedbackNotifications" -Value 1 -Type DWord 936 | Set-Registry -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -Value 0 -Type DWord 937 | Set-Registry -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Name "PeriodInNanoSeconds" -Value 0 -Type DWord 938 | Write-Host "Explorer: Feedback Notifications [DISABLED]" -ForegroundColor Green 939 | 940 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "EnableSnapBar" -Type DWord -Value 0 941 | Write-Host "Explorer: Snap Layout [DISABLED]" -ForegroundColor Green 942 | 943 | Set-Registry -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer' -Name 'ShowFrequent' -Value 0 -Type DWord 944 | Write-Host "Explorer: 'Recent Folders' in Quick Access [DISABLED]" -ForegroundColor Green 945 | 946 | # Remove Widgets (Reinstall Source: https://apps.microsoft.com/detail/windows-web-experience-pack/9MSSGKG348SP?hl=en-us&gl=US) 947 | winget uninstall --accept-source-agreements "Windows web experience pack" | Out-Null 948 | Set-Registry -Path "HKLM:\SOFTWARE\Policies\Microsoft\Dsh" -Name "AllowNewsAndInterests" -Type DWord -Value 0 949 | Write-Host "Explorer: Widgets [REMOVED]" -ForegroundColor Green 950 | 951 | Set-Registry -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\System' -Name 'DisableLogonBackgroundImage' -Type DWord -Value 1 952 | Write-Host "Explorer: Background on Login Screen [DISABLED]" -ForegroundColor Green 953 | 954 | # Source: https://www.kapilarya.com/disable-tips-and-suggestions-notifications-in-windows-11 955 | Set-Registry -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableSoftLanding" -Type DWord -Value 1 956 | Write-Host "Explorer: Tips [DISABLED]" -ForegroundColor Green 957 | 958 | # Source: https://documentation.n-able.com/N-central/userguide/Content/Automation/Policies/Diagnostics/pol_UACEnabled_Check.htm 959 | Set-Registry -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Value 0 -Type DWord 960 | Write-Host "Explorer: User Access Control - Prompt for Admins [DISABLED]" -ForegroundColor Green 961 | 962 | Set-Registry -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' -Name "PromptOnSecureDesktop" -Value 0 -Type DWord 963 | Write-Host "Explorer: User Access Control - Desktop Dimming [DISABLED]" -ForegroundColor Green 964 | 965 | Set-Registry -Path "HKCU:\Control Panel\Desktop" -Name "AnimateMinimize" -Value "0" -Type String 966 | Set-Registry -Path "HKCU:\Control Panel\Desktop\WindowMetrics" -Name "MinAnimate" -Value "0" -Type String 967 | Set-Registry -Path "HKCU:\Control Panel\Desktop" -Name "AnimateWindows" -Value "0" -Type String 968 | Write-Host "Explorer: Animations (Minimize/Maximize) [DISABLED]" -ForegroundColor Green 969 | 970 | # Settings > Accessibility > Visual Effects > Transparency Effects 971 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "EnableTransparency" -Value "0" -Type DWord 972 | Write-Host "Explorer: Transparency [DISABLED]" -ForegroundColor Green 973 | 974 | # Co-Pilot 975 | Set-Registry -Path "HKCU:\Software\Policies\Microsoft\Windows\WindowsCopilot" -Name "TurnOffWindowsCopilot" -Value 0 -Type DWord 976 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications\Microsoft.Copilot_8wekyb3d8bbwe" -Name "Disabled" -Value 1 -Type DWord 977 | 978 | # Task Bar Removal 979 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowCopilotButton" -Value 0 -Type DWord 980 | # Right Click Menu "Ask Co-Pilot" 981 | Set-Registry -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked' -Name '{CB3B0003-8088-4EDE-8769-8B354AB2FF8C}' -Value '' -Type String 982 | Write-Host "Explorer: Microsoft Co-Pilot SHORTCUT [REMOVED]" -ForegroundColor Green 983 | <###################################### EXPLORER TWEAKS (End) ######################################> 984 | 985 | 986 | 987 | <###################################### START MENU TWEAKS (Start) ######################################> 988 | if ((Get-WMIObject win32_operatingsystem) | Where-Object { $_.Name -like "Microsoft Windows 11*" }) { 989 | #Source: https://vhorizon.co.uk/windows-11-start-menu-layout-group-policy/ 990 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarAl" -Value 0 -Type DWord 991 | Write-Host "Start Menu: Alignment - Left" -ForegroundColor Green 992 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Start_Layout" -Value 1 -Type DWord 993 | Write-Host "Start Menu: Reduced 'Recommended Apps' [UPDATE]" -ForegroundColor Green 994 | } 995 | 996 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" -Value 0 -Type DWord 997 | Write-host "Start Menu: 'Task View' Button [HIDDEN]" -ForegroundColor Green 998 | 999 | Set-Registry -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "SearchBoxTaskbarMode" -Value 0 -Type DWord 1000 | Write-host "Start Menu: 'Search' Button [HIDDEN]" -ForegroundColor Green 1001 | 1002 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarDa" -Value 0 -Type DWord 1003 | Write-Host "Start Menu: Weather Widget [HIDDEN]" -ForegroundColor Green 1004 | 1005 | # Start Menu - Disable Metro app suggestions. 1006 | Set-Registry -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Type DWord -Value "0" 1007 | Write-Host "Start Menu: Metro App Suggestions [DISABLED]" -ForegroundColor Green 1008 | 1009 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarAnimations" -Value 0 -Type DWord 1010 | Write-Host "Start Menu: Animations - Icons [DISABLED]" -ForegroundColor Green 1011 | 1012 | Set-Registry -Path "HKCU:\Control Panel\Desktop" -Name "MenuShowDelay" -Value 1 -Type String 1013 | Write-Host "Start Menu: Animations - Appear/Load Time [REDUCED]" -ForegroundColor Green 1014 | 1015 | # Add 'Devices and Printers' to Start Menu 1016 | $ShortcutPath = [System.IO.Path]::Combine([System.Environment]::GetFolderPath("CommonPrograms"), "Devices & Printers.lnk") 1017 | $WshShell = New-Object -ComObject WScript.Shell 1018 | $Shortcut = $WshShell.CreateShortcut($ShortcutPath) 1019 | $Shortcut.TargetPath = "shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}" 1020 | $Shortcut.Save() 1021 | [System.Runtime.Interopservices.Marshal]::ReleaseComObject($WshShell) | Out-Null 1022 | Write-Host "Start Menu: 'Devices & Printers' [ADDED]" -ForegroundColor Green 1023 | 1024 | # Add 'Devices and Printers (Drivers)' to Start Menu 1025 | $ShortcutPath = [System.IO.Path]::Combine([System.Environment]::GetFolderPath("CommonPrograms"), "Devices & Printers (Drivers).lnk") 1026 | $WshShell = New-Object -ComObject WScript.Shell 1027 | $Shortcut = $WshShell.CreateShortcut($ShortcutPath) 1028 | $Shortcut.TargetPath = "C:\Windows\System32\rundll32.exe" 1029 | $Shortcut.Arguments = "printui.dll,PrintUIEntry /s" 1030 | $Shortcut.IconLocation = "C:\Windows\System32\imageres.dll,38" 1031 | $Shortcut.Save() 1032 | [System.Runtime.Interopservices.Marshal]::ReleaseComObject($WshShell) | Out-Null 1033 | Write-Host "Start Menu: 'Devices & Printers (Drivers)' [ADDED]" -ForegroundColor Green 1034 | 1035 | # Add 'Devices and Printers (Add Network Printer)' to Start Menu 1036 | $ShortcutPath = [System.IO.Path]::Combine([System.Environment]::GetFolderPath("CommonPrograms"), "Devices & Printers (Add Network).lnk") 1037 | $WshShell = New-Object -ComObject WScript.Shell 1038 | $Shortcut = $WshShell.CreateShortcut($ShortcutPath) 1039 | $Shortcut.TargetPath = "C:\Windows\System32\rundll32.exe" 1040 | $Shortcut.Arguments = "printui.dll,PrintUIEntry /il" 1041 | $Shortcut.IconLocation = "C:\Windows\System32\imageres.dll,39" 1042 | $Shortcut.Save() 1043 | [System.Runtime.Interopservices.Marshal]::ReleaseComObject($WshShell) | Out-Null 1044 | Write-Host "Start Menu: 'Devices & Printers (Add Network)' [ADDED]" -ForegroundColor Green 1045 | 1046 | <###################################### START MENU TWEAKS (End) ######################################> 1047 | 1048 | 1049 | 1050 | <###################################### NETWORK TWEAKS (Start) ######################################> 1051 | Get-NetAdapter -Physical | Where-Object Status -eq 'Up' | ForEach-Object { 1052 | Disable-NetAdapterPowerManagement -Name $_.Name -DeviceSleepOnDisconnect -NoRestart | Out-Null 1053 | } 1054 | Write-Host "Network: Ethernet/Wireless Power Saving Settings [DISABLED]" -ForegroundColor Green 1055 | 1056 | # Source: https://www.majorgeeks.com/content/page/irpstacksize.html (Default 15-20 connections, increased to 50) 1057 | Set-Registry -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters' -Name 'IRPStackSize' -Value 48 -Type DWord 1058 | Write-Host "Network: Increased Performance for 'I/O Request Packet Stack Size" -ForegroundColor Green 1059 | 1060 | Set-Registry -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile' -Name 'NetworkThrottlingIndex' -Value -1 -Type DWord 1061 | Set-Registry -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Psched' -Name 'NonBestEffortLimit' -Value 0 -Type DWord 1062 | Write-Host "Network: Throttling Index [DISABLED]" -ForegroundColor Green 1063 | 1064 | netsh int tcp set global autotuninglevel=disabled 1065 | Write-Host "Network: TCP Auto-Tuning [DISABLED]" -ForegroundColor Green 1066 | 1067 | netsh int tcp set global rss=enabled 1068 | Write-Host "Network: Receive-Side Scaling (RSS) [ENABLED]" -ForegroundColor Green 1069 | 1070 | netsh int tcp set global dca=enabled 1071 | Write-Host "Network: Direct Cache Access (DCA) [ENABLED]" -ForegroundColor Green 1072 | 1073 | netsh int tcp set global ecncapability=disabled 1074 | Write-Host "Network: Explicit Congestion Notification (ECN) [DISABLED]" -ForegroundColor Green 1075 | 1076 | netsh int tcp set global netdma=disabled 1077 | Write-Host "Network: NetDMA [DISABLED]" -ForegroundColor Green 1078 | 1079 | netsh int tcp set supplemental template=internet congestionprovider=ctcp 1080 | Write-Host "Network: TCP Congestion Provider set to Compound TCP (CTCP)" -ForegroundColor Green 1081 | <###################################### NETWORK TWEAKS (End) ######################################> 1082 | 1083 | 1084 | 1085 | <###################################### WINDOWS TWEAKS (Start) ######################################> 1086 | # Disable 'High Precision Event Timer' to prevent input lag/delays 1087 | bcdedit /deletevalue useplatformclock 1088 | bcdedit /set useplatformtick yes 1089 | bcdedit /set disabledynamictick yes 1090 | Write-Host "Windows: Disabled 'High Precision Event Timer' - Formerly Multimedia Timer" -ForegroundColor Green 1091 | 1092 | Set-Registry -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games' -Name 'GPU Priority' -Value 7 -Type DWord 1093 | Set-Registry -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games' -Name 'Priority' -Value 5 -Type DWord 1094 | Set-Registry -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games' -Name 'Scheduling Category' -Value 'High' -Type String 1095 | Write-Host "Windows: Updating 'MMCSS' to prioritize games with higher system resources" -ForegroundColor Green 1096 | 1097 | Set-Registry -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power' -Name 'HiberbootEnabled' -Value 0 -Type DWord 1098 | Write-Host "Windows: Disabled Fast Startup - Restored 'Fresh' Reboot" -ForegroundColor Green 1099 | 1100 | Set-Registry -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' -Name 'ClearPageFileAtShutdown' -Value 1 -Type DWord 1101 | Write-Host "Windows: Paging File - Cleared at Shutdown" -ForegroundColor Green 1102 | 1103 | # Source: https://www.thewindowsclub.com/disable-windows-10-startup-delay-startupdelayinmsec (Default=10ms) 1104 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Serialize" -Name "StartupDelayInMSec" -Value 5 -Type DWord 1105 | Write-Host "Windows: Reduced Startup Delay" -ForegroundColor Green 1106 | 1107 | # MarkC's Mouse Acceleration Fix (DPI 100% Scale - Default) 1108 | # Source: http://donewmouseaccel.blogspot.com/ 1109 | <# Disable 'Enhance pointer precision' #> 1110 | Set-Registry -Path 'HKCU:\Control Panel\Mouse' -Name 'MouseSpeed' -Value 0 -Type String 1111 | Set-Registry -Path 'HKCU:\Control Panel\Mouse' -Name 'MouseThreshold1' -Value 0 -Type String 1112 | Set-Registry -Path 'HKCU:\Control Panel\Mouse' -Name 'MouseThreshold2' -Value 0 -Type String 1113 | Write-Host "Windows: Mouse Acceleration - Disabled Enhance Pointer Precision" -ForegroundColor Green 1114 | 1115 | $MouseSensitivity = (Get-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseSensitivity").MouseSensitivity 1116 | IF((Get-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseSensitivity").MouseSensitivity -eq 1) { 1117 | New-ItemProperty -LiteralPath 'HKCU:\Control Panel\Mouse' -Name 'SmoothMouseXCurve' -Value ([byte[]](0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0x1E,0x05,0x00,0x00,0x00,0x00,0x00,0x28,0x3D,0x0A,0x00,0x00,0x00,0x00,0x00,0xBC,0x5B,0x0F,0x00,0x00,0x00,0x00,0x00,0x50,0x7A,0x14,0x00,0x00,0x00,0x00,0x00)) -PropertyType Binary -Force | Out-Null 1118 | New-ItemProperty -LiteralPath 'HKCU:\Control Panel\Mouse' -Name 'SmoothMouseYCurve' -Value ([byte[]](0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEC,0xFF,0xDF,0x00,0x00,0x00,0x00,0x00,0xD8,0xFF,0xBF,0x01,0x00,0x00,0x00,0x00,0xC4,0xFF,0x9F,0x02,0x00,0x00,0x00,0x00,0xB0,0xFF,0x7F,0x03,0x00,0x00,0x00,0x00)) -PropertyType Binary -Force | Out-Null 1119 | Write-Host "Windows: Mouse 'Mouse Curve' adjusting to detected sensitivity $MouseSensitivity." -ForegroundColor Green; 1120 | } 1121 | IF((Get-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseSensitivity").MouseSensitivity -eq 2) { 1122 | New-ItemProperty -LiteralPath 'HKCU:\Control Panel\Mouse' -Name 'SmoothMouseXCurve' -Value ([byte[]](0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAE,0x1E,0x05,0x00,0x00,0x00,0x00,0x00,0x5C,0x3D,0x0A,0x00,0x00,0x00,0x00,0x00,0x0A,0x5C,0x0F,0x00,0x00,0x00,0x00,0x00,0xB8,0x7A,0x14,0x00,0x00,0x00,0x00,0x00)) -PropertyType Binary -Force | Out-Null 1123 | New-ItemProperty -LiteralPath 'HKCU:\Control Panel\Mouse' -Name 'SmoothMouseYCurve' -Value ([byte[]](0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x6F,0x00,0x00,0x00,0x00,0x00,0xFE,0xFF,0xDF,0x00,0x00,0x00,0x00,0x00,0xFD,0xFF,0x4F,0x01,0x00,0x00,0x00,0x00,0xFC,0xFF,0xBF,0x01,0x00,0x00,0x00,0x00)) -PropertyType Binary -Force | Out-Null 1124 | Write-Host "Windows: Mouse 'Mouse Curve' adjusting to detected sensitivity $MouseSensitivity." -ForegroundColor Green; 1125 | } 1126 | IF((Get-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseSensitivity").MouseSensitivity -eq 3) { 1127 | New-ItemProperty -LiteralPath 'HKCU:\Control Panel\Mouse' -Name 'SmoothMouseXCurve' -Value ([byte[]](0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0xD6,0x03,0x00,0x00,0x00,0x00,0x00,0xF8,0xAD,0x07,0x00,0x00,0x00,0x00,0x00,0xF4,0x84,0x0B,0x00,0x00,0x00,0x00,0x00,0xF0,0x5B,0x0F,0x00,0x00,0x00,0x00,0x00)) -PropertyType Binary -Force | Out-Null 1128 | New-ItemProperty -LiteralPath 'HKCU:\Control Panel\Mouse' -Name 'SmoothMouseYCurve' -Value ([byte[]](0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x37,0x00,0x00,0x00,0x00,0x00,0xFE,0xFF,0x6F,0x00,0x00,0x00,0x00,0x00,0xFD,0xFF,0xA7,0x00,0x00,0x00,0x00,0x00,0xFC,0xFF,0xDF,0x00,0x00,0x00,0x00,0x00)) -PropertyType Binary -Force | Out-Null 1129 | Write-Host "Windows: Mouse 'Mouse Curve' adjusting to detected sensitivity $MouseSensitivity." -ForegroundColor Green; 1130 | } 1131 | IF((Get-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseSensitivity").MouseSensitivity -eq 4) { 1132 | New-ItemProperty -LiteralPath 'HKCU:\Control Panel\Mouse' -Name 'SmoothMouseXCurve' -Value ([byte[]](0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAE,0x1E,0x05,0x00,0x00,0x00,0x00,0x00,0x5C,0x3D,0x0A,0x00,0x00,0x00,0x00,0x00,0x0A,0x5C,0x0F,0x00,0x00,0x00,0x00,0x00,0xB8,0x7A,0x14,0x00,0x00,0x00,0x00,0x00)) -PropertyType Binary -Force | Out-Null 1133 | New-ItemProperty -LiteralPath 'HKCU:\Control Panel\Mouse' -Name 'SmoothMouseYCurve' -Value ([byte[]](0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x00,0x00,0x00,0x00,0x00)) -PropertyType Binary -Force | Out-Null 1134 | Write-Host "Windows: Mouse 'Mouse Curve' adjusting to detected sensitivity $MouseSensitivity." -ForegroundColor Green; 1135 | } 1136 | IF((Get-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseSensitivity").MouseSensitivity -eq 5) { 1137 | New-ItemProperty -LiteralPath 'HKCU:\Control Panel\Mouse' -Name 'SmoothMouseXCurve' -Value ([byte[]](0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x66,0x06,0x00,0x00,0x00,0x00,0x00,0xC0,0xCC,0x0C,0x00,0x00,0x00,0x00,0x00,0x20,0x33,0x13,0x00,0x00,0x00,0x00,0x00,0x80,0x99,0x19,0x00,0x00,0x00,0x00,0x00)) -PropertyType Binary -Force | Out-Null 1138 | New-ItemProperty -LiteralPath 'HKCU:\Control Panel\Mouse' -Name 'SmoothMouseYCurve' -Value ([byte[]](0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x00,0x00,0x00,0x00,0x00)) -PropertyType Binary -Force | Out-Null 1139 | Write-Host "Windows: Mouse 'Mouse Curve' adjusting to detected sensitivity $MouseSensitivity." -ForegroundColor Green; 1140 | } 1141 | IF((Get-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseSensitivity").MouseSensitivity -eq 6) { 1142 | New-ItemProperty -LiteralPath 'HKCU:\Control Panel\Mouse' -Name 'SmoothMouseXCurve' -Value ([byte[]](0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0xAE,0x07,0x00,0x00,0x00,0x00,0x00,0x08,0x5C,0x0F,0x00,0x00,0x00,0x00,0x00,0x0C,0x0A,0x17,0x00,0x00,0x00,0x00,0x00,0x10,0xB8,0x1E,0x00,0x00,0x00,0x00,0x00)) -PropertyType Binary -Force 1143 | New-ItemProperty -LiteralPath 'HKCU:\Control Panel\Mouse' -Name 'SmoothMouseYCurve' -Value ([byte[]](0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF9,0xFF,0x37,0x00,0x00,0x00,0x00,0x00,0xF2,0xFF,0x6F,0x00,0x00,0x00,0x00,0x00,0xEB,0xFF,0xA7,0x00,0x00,0x00,0x00,0x00,0xE4,0xFF,0xDF,0x00,0x00,0x00,0x00,0x00)) -PropertyType Binary -Force 1144 | Write-Host "Windows: Mouse 'Mouse Curve' adjusting to detected sensitivity $MouseSensitivity." -ForegroundColor Green; 1145 | } 1146 | IF((Get-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseSensitivity").MouseSensitivity -eq 7) { 1147 | New-ItemProperty -LiteralPath 'HKCU:\Control Panel\Mouse' -Name 'SmoothMouseXCurve' -Value ([byte[]](0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB6,0xF5,0x08,0x00,0x00,0x00,0x00,0x00,0x6C,0xEB,0x11,0x00,0x00,0x00,0x00,0x00,0x22,0xE1,0x1A,0x00,0x00,0x00,0x00,0x00,0xD8,0xD6,0x23,0x00,0x00,0x00,0x00,0x00)) -PropertyType Binary -Force | Out-Null 1148 | New-ItemProperty -LiteralPath 'HKCU:\Control Panel\Mouse' -Name 'SmoothMouseYCurve' -Value ([byte[]](0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFA,0xFF,0x37,0x00,0x00,0x00,0x00,0x00,0xF4,0xFF,0x6F,0x00,0x00,0x00,0x00,0x00,0xEE,0xFF,0xA7,0x00,0x00,0x00,0x00,0x00,0xE8,0xFF,0xDF,0x00,0x00,0x00,0x00,0x00)) -PropertyType Binary -Force | Out-Null 1149 | Write-Host "Windows: Mouse 'Mouse Curve' adjusting to detected sensitivity $MouseSensitivity." -ForegroundColor Green; 1150 | } 1151 | IF((Get-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseSensitivity").MouseSensitivity -eq 8) { 1152 | New-ItemProperty -LiteralPath 'HKCU:\Control Panel\Mouse' -Name 'SmoothMouseXCurve' -Value ([byte[]](0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5C,0x3D,0x0A,0x00,0x00,0x00,0x00,0x00,0xB8,0x7A,0x14,0x00,0x00,0x00,0x00,0x00,0x14,0xB8,0x1E,0x00,0x00,0x00,0x00,0x00,0x70,0xF5,0x28,0x00,0x00,0x00,0x00,0x00)) -PropertyType Binary -Force | Out-Null 1153 | New-ItemProperty -LiteralPath 'HKCU:\Control Panel\Mouse' -Name 'SmoothMouseYCurve' -Value ([byte[]](0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x00,0x00,0x00,0x00,0x00)) -PropertyType Binary -Force | Out-Null 1154 | Write-Host "Windows: Mouse 'Mouse Curve' adjusting to detected sensitivity $MouseSensitivity." -ForegroundColor Green; 1155 | } 1156 | IF((Get-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseSensitivity").MouseSensitivity -eq 9) { 1157 | New-ItemProperty -LiteralPath 'HKCU:\Control Panel\Mouse' -Name 'SmoothMouseXCurve' -Value ([byte[]](0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x85,0x0B,0x00,0x00,0x00,0x00,0x00,0x1C,0x0A,0x17,0x00,0x00,0x00,0x00,0x00,0x2A,0x8F,0x22,0x00,0x00,0x00,0x00,0x00,0x38,0x14,0x2E,0x00,0x00,0x00,0x00,0x00)) -PropertyType Binary -Force | Out-Null 1158 | New-ItemProperty -LiteralPath 'HKCU:\Control Panel\Mouse' -Name 'SmoothMouseYCurve' -Value ([byte[]](0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x00,0x00,0x00,0x00,0x00)) -PropertyType Binary -Force | Out-Null 1159 | Write-Host "Windows: Mouse 'Mouse Curve' adjusting to detected sensitivity $MouseSensitivity." -ForegroundColor Green; 1160 | } 1161 | IF((Get-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseSensitivity").MouseSensitivity -eq 10) { 1162 | New-ItemProperty -LiteralPath 'HKCU:\Control Panel\Mouse' -Name 'SmoothMouseXCurve' -Value ([byte[]](0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xCC,0x0C,0x00,0x00,0x00,0x00,0x00,0x80,0x99,0x19,0x00,0x00,0x00,0x00,0x00,0x40,0x66,0x26,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x33,0x00,0x00,0x00,0x00,0x00)) -PropertyType Binary -Force | Out-Null 1163 | New-ItemProperty -LiteralPath 'HKCU:\Control Panel\Mouse' -Name 'SmoothMouseYCurve' -Value ([byte[]](0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x00,0x00,0x00,0x00,0x00)) -PropertyType Binary -Force | Out-Null 1164 | Write-Host "Windows: Mouse 'Mouse Curve' adjusting to detected sensitivity $MouseSensitivity." -ForegroundColor Green; 1165 | } 1166 | 1167 | Set-Registry -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications' -Name 'ToastEnabled' -Value 0 -Type DWord 1168 | Write-Host "Windows: Toast Notifications [DISABLED]" -ForegroundColor Green 1169 | 1170 | Set-Registry -Path 'HKCU:\Control Panel\Accessibility\StickyKeys' -Name 'Flags' -Value '506' -Type String 1171 | Write-Host "Windows: Sticky Keys [DISABLED]" -ForegroundColor Green 1172 | 1173 | Set-Registry -Path 'HKCU:\Control Panel\Accessibility\ToggleKeys' -Name 'Flags' -Value '58' -Type String 1174 | Write-Host "Windows: Filter Keys [DISABLED]" -ForegroundColor Green 1175 | 1176 | Set-Registry -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppCompat' -Name 'DisableUAR' -Value 1 -Type DWord 1177 | Write-Host "Windows: Troubleshooting 'Steps Recorder' [DISABLED]" -ForegroundColor Green 1178 | 1179 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\GameDVR" -Name "AppCaptureEnabled" -Value 0 -Type DWord 1180 | Set-Registry -Path "HKCU:\System\GameConfigStore" -Name "GameDVR_Enabled" -Value 0 -Type DWord 1181 | Write-Host "Windows: Game Bar [DISABLED]" -ForegroundColor Green 1182 | 1183 | # Smart Screening 1184 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AppHost" -Name "EnableWebContentEvaluation" -Value "0" -Type DWord 1185 | Set-Registry -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "EnableSmartScreen" -Value "0" -Type DWord 1186 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "SmartScreenEnabled" -Value "Off" -Type String 1187 | Write-Host "Windows: App Smart Screening [DISABLED]" -ForegroundColor Green 1188 | 1189 | # Remote Desktop 1190 | Set-Registry -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -Name 'fDenyTSConnections' -Value 0 -Type DWord 1191 | if (-not (Get-NetFirewallRule -DisplayName "Remote Desktop - TCP (3389)" -ErrorAction SilentlyContinue)) { 1192 | netsh advfirewall firewall add rule name="Remote Desktop - TCP (3389)" dir=in action=allow protocol=TCP localport=3389 profile=domain,private 1193 | } 1194 | Write-Host "Windows: Remote Desktop [ENABLED]" -ForegroundColor Green 1195 | 1196 | # Lockscreen rotating pictures 1197 | Set-Registry -Path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' -Name 'RotatingLockScreenEnabled' -Value 0 -Type DWord 1198 | Set-Registry -Path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' -Name 'RotatingLockScreenOverlayEnabled' -Value 0 -Type DWord 1199 | Write-Host "Windows: Lockscreen rotating pictures [DISABLED]" -ForegroundColor Green 1200 | 1201 | Set-Registry -Path 'HKCU:\Control Panel\Desktop' -Name 'ForegroundLockTimeout' -Value 0 -Type DWord 1202 | Set-Registry -Path 'HKCU:\Control Panel\Desktop' -Name 'HungAppTimeout' -Value '400' -Type String 1203 | Set-Registry -Path 'HKCU:\Control Panel\Desktop' -Name 'WaitToKillAppTimeout' -Value '500' -Type String 1204 | Set-Registry -Path 'HKLM:\SYSTEM\CurrentControlSet\Control' -Name 'WaitToKillServiceTimeout' -Value '500' -Type String 1205 | Write-Host "Windows: Faster Shutdown [ENABLED]" -ForegroundColor Green 1206 | 1207 | # 'Microsoft from getting to know you' 1208 | Set-Registry -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -Value 0 -Type DWord 1209 | Set-Registry -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Value 0 -Type DWord 1210 | Set-Registry -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Value 0 -Type DWord 1211 | Set-Registry -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -Value 0 -Type DWord 1212 | Set-Registry -Path "HKCU:\SOFTWARE\Microsoft\Input\TIPC" -Name "Enabled" -Value 0 -Type DWord 1213 | Set-Registry -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "HistoryViewEnabled" -Value 0 -Type DWord 1214 | Write-Host "Windows: 'Microsoft from getting to know you' [DISABLED]" -ForegroundColor Green 1215 | 1216 | # Split Service Host Threshold for increased reliablity 1217 | # Source: https://www.tenforums.com/tutorials/94628-change-split-threshold-svchost-exe-windows-10-a.html 1218 | $RamInKB = (Get-CimInstance -ClassName Win32_PhysicalMemory | Measure-Object -Property Capacity -Sum).Sum / 1KB 1219 | $RamInKB = (Get-CimInstance -ClassName Win32_PhysicalMemory | Measure-Object -Property Capacity -Sum).Sum / 1KB 1220 | if ($RamInKB -ge 16000000) { 1221 | Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control" -Name "SvcHostSplitThresholdInKB" -Value $RamInKB -Force 1222 | Write-Host "Windows: Reduced Service Host Threshold [UPDATED]" -ForegroundColor Green 1223 | } else { 1224 | Write-Host "Windows: Reduced Service Host Threshold (Ram <16GB) [SKIPPED]" -ForegroundColor Yellow 1225 | } 1226 | 1227 | # Windows Update Delivery Optimization 1228 | # Source: https://www.elevenforum.com/t/turn-on-or-off-windows-update-delivery-optimization-in-windows-11.3136 1229 | Set-Registry -Path 'Registry::\HKEY_USERS\S-1-5-20\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Settings' -Name 'DownloadMode' -Value 0 -Type DWord 1230 | Write-Host "Windows: Update Delivery Optimization - Direct Download [UPDATED]" -ForegroundColor Green 1231 | 1232 | # Windows > Display 'Ease cursor Movement between displays' 1233 | Set-Registry -Path 'HKCU:\Control Panel\Cursors' -Name 'CursorDeadzoneJumpingSetting' -Value 0 -Type DWord 1234 | Write-Host "Windows: 'Ease cursor Movement between displays' [DISABLED]" -ForegroundColor Green 1235 | 1236 | # Windows Background (Spotlight) - Remove "Learn About This Background" 1237 | Set-Registry -Remove Path -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{2cc5ca98-6485-489a-920e-b3e88a6ccce3}" 1238 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Name "{2cc5ca98-6485-489a-920e-b3e88a6ccce3}" -Value 1 -Type DWord 1239 | Write-Host "Windows: Background (Spotlight) - 'Learn About This Background' [REMOVED]" -ForegroundColor Green 1240 | 1241 | # Source: https://www.tomshardware.com/how-to/disable-vbs-windows-11 1242 | #> Disable VBS & Device Guard 1243 | Set-Registry -Path "HKLM:\SYSTEM\CurrentControlSet\Control\DeviceGuard" -Name "EnableVirtualizationBasedSecurity" -Value 0 -Type DWord 1244 | Set-Registry -Path "HKLM:\SYSTEM\CurrentControlSet\Control\DeviceGuard" -Name "RequirePlatformSecurityFeatures" -Value 0 -Type DWord 1245 | #> Disable Credential Guard 1246 | Set-Registry -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" -Name "RunAsPPL" -Value 0 -Type DWord 1247 | Set-Registry -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" -Name "LsaCfgFlags" -Value 0 -Type DWord 1248 | Write-Host "Windows: Virtualization-Based Security [DISABLED]" -ForegroundColor Green 1249 | 1250 | Set-Registry -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerThrottling" -Name "PowerThrottlingOff" -Value 1 -Type DWord 1251 | Write-Host "Windows: Power Throttling [DISABLED]" -ForegroundColor Green 1252 | 1253 | Set-Registry -Remove Value -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" -Name "SecurityHealth" 1254 | Set-Registry -Remove Value -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run" -Name "SecurityHealth" 1255 | Write-Host "Windows: Security System Tray Icon [HIDDEN]" -ForegroundColor Green 1256 | 1257 | $VMsRunning = Get-VM | Where-Object { $_.State -eq 'Running' } 1258 | if ($VMsRunning -or (Test-Path "C:\Program Files\Docker\")) { 1259 | Write-Host "Windows: Hyper-V [Skipped]" -ForegroundColor Yellow 1260 | } else { 1261 | Set-Registry -Path "HKLM:\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity" -Name "Enabled" -Value 0 -Type DWord 1262 | Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All -NoRestart | Out-Null 1263 | Disable-WindowsOptionalFeature -Online -FeatureName "HypervisorPlatform" -NoRestart | Out-Null 1264 | Disable-WindowsOptionalFeature -Online -FeatureName "VirtualMachinePlatform" -NoRestart | Out-Null 1265 | bcdedit /set hypervisorlaunchtype off 1266 | Write-Host "Windows: Hyper-V [DISABLED]" -ForegroundColor Green 1267 | } 1268 | 1269 | # Source: https://www.elevenforum.com/t/restore-missing-startup-apps-page-in-settings-in-windows-11.30997/ 1270 | Set-Registry -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "SettingsPageVisibility" -Remove Value 1271 | Set-Registry -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "SupportUwpStartupTasks" -Value 1 -Type DWord 1272 | Set-Registry -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "EnableFullTrustStartupTasks" -Value 2 -Type DWord 1273 | Set-Registry -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "EnableUwpStartupTasks" -Value 2 -Type DWord 1274 | Set-Registry -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "SupportFullTrustStartupTasks" -Value 1 -Type DWord 1275 | Write-Host "Windows: 'Startup' option restored in Settings > Apps [RESTORED]" -ForegroundColor Green 1276 | 1277 | Set-Registry -Path "HKCU:\Control Panel\International" -Name "sShortDate" -Value "M/d/yy" -Type String 1278 | Write-Host "Windows: System Tray time set to MM/DD/YY [UPDATED]" -ForegroundColor Green 1279 | <###################################### WINDOWS TWEAKS (End) ######################################> 1280 | 1281 | 1282 | 1283 | <###################################### TEST TWEAKS (Start) ######################################> 1284 | <# Visual Settings 1285 | Set-ItemProperty -Path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects' -Name 'VisualFXSetting' -Value "0" 1286 | Set-ItemProperty -Path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects' -Name 'VisualFXSetting' -Value 393241 1287 | New-ItemProperty -LiteralPath 'HKCU:\Control Panel\Desktop' -Name 'UserPreferencesMask' -Value ([byte[]](0x10,0x32,0x07,0x80,0x10,0x00,0x00,0x00)) -PropertyType Binary -Force 1288 | Write-Host "Explorer: Set Optimal Visual Settings" -ForegroundColor Green 1289 | #> 1290 | <###################################### TEST TWEAKS (Ened) ######################################> 1291 | #endregion 1292 | 1293 | 1294 | <#############################################################################################################################> 1295 | #region 6.0 - Power Settings 1296 | Write-Host "`n`n6.0 Power Settings" -ForegroundColor Green 1297 | Powercfg /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 1298 | Write-Host "Sleep Settings: Set to High Performance" -ForegroundColor Green 1299 | Powercfg /Change monitor-timeout-ac 15 1300 | Powercfg /Change monitor-timeout-dc 15 1301 | Write-Host "Sleep Settings: Monitor (Battery: 15 Mins | AC: 15 Mins)" -ForegroundColor Green 1302 | 1303 | Powercfg /Change standby-timeout-ac 0 1304 | Powercfg /Change standby-timeout-dc 60 1305 | Write-Host "Sleep Settings: PC (Battery: 1 Hour | AC: Never)" -ForegroundColor Green 1306 | 1307 | powercfg /Change -disk-timeout-dc 0 1308 | powercfg /Change -disk-timeout-ac 0 1309 | Write-Host "Sleep Settings: Hard Drive (Battery: Never | AC: Never)" -ForegroundColor Green 1310 | 1311 | powercfg /Change -hibernate-timeout-ac 0 1312 | powercfg /Change -hibernate-timeout-dc 0 1313 | powercfg -h off 1314 | Write-Host "Sleep Settings: Hibernate [DISABLED]" -ForegroundColor Green 1315 | 1316 | powercfg -setacvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0 1317 | powercfg -setdcvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0 1318 | Write-Host "Sleep Settings: 'Closing Lid' action to turn off screen" [CHANGED] -ForegroundColor Green 1319 | 1320 | Set-Registry -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings' -Name 'ShowSleepOption' -Value 0 -Type DWord 1321 | Set-Registry -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings' -Name 'ShowHibernateOption' -Value 0 -Type DWord 1322 | Write-Host "Sleep Settings: Sleep/Hibernate from Start Menu [DISABLED]" -ForegroundColor Green 1323 | 1324 | Set-Registry -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "IsBatteryPercentageEnabled" -Value 1 -Type DWord 1325 | Write-Host "Battery: Percentage [ENABLED]" -ForegroundColor Green 1326 | #endregion 1327 | 1328 | 1329 | <#############################################################################################################################> 1330 | #region 7.0 - Privacy 1331 | Write-Host "`n`n7.0 Privacy" -ForegroundColor Green 1332 | ## Applications 1333 | Write-Host "7.1 Applications" -ForegroundColor Green 1334 | Set-Registry -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location' -Name 'Value' -Value 'Deny' -Type String 1335 | Set-Registry -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}' -Name 'SensorPermissionState' -Value 1 -Type DWord -CreatePath 1336 | Set-Registry -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration' -Name 'EnableStatus' -Value 1 -Type DWord -CreatePath 1337 | Write-Host "Applications - Location Permissions [DISABLED]" -ForegroundColor Green 1338 | 1339 | Set-Registry -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appDiagnostics' -Name 'Value' -Value 'Deny' -Type String 1340 | Write-Host "Applications - Diagnostics [DISABLED]" -ForegroundColor Green 1341 | 1342 | Write-Host "7.2 Keyboard" -ForegroundColor Green 1343 | Set-Registry -Path 'HKLM:\SOFTWARE\Microsoft\PolicyManager\default\TextInput\AllowLinguisticDataCollection' -Name 'value' -Value 0 -Type DWord -CreatePath 1344 | Set-Registry -Path 'HKCU:\Software\Microsoft\Input\TIPC' -Name 'Enabled' -Value 0 -Type DWord -CreatePath 1345 | Write-Host "Keyboard - Improved Inking and Typing Reconition [DISABLED]" -ForegroundColor Green 1346 | 1347 | Write-Host "7.3 Clipboard" -ForegroundColor Green 1348 | Set-Registry -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\SmartActionPlatform\SmartClipboard' -Name 'Disabled' -Value 1 -Type DWord -CreatePath 1349 | Write-Host "Clipboard - 'Smart Clipboard' [DISABLED]" -ForegroundColor Green 1350 | 1351 | Write-Host "7.4 Telemetry" -ForegroundColor Green #InTune Required 1352 | # Disable Tailored Experiences With Diagnostic Data 1353 | Set-Registry -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Privacy' -Name 'TailoredExperiencesWithDiagnosticDataEnabled' -Value 0 -Type DWord 1354 | # Disable Activites 1355 | Set-Registry -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\System' -Name 'EnableActivityFeed' -Value 0 -Type DWord 1356 | Set-Registry -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\System' -Name 'PublishUserActivities' -Value 0 -Type DWord 1357 | Set-Registry -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\System' -Name 'UploadUserActivities' -Value 0 -Type DWord 1358 | Write-Host "Windows: Activity Feed [DISABLED]" -ForegroundColor Green 1359 | # Disable Telemetry 1360 | Set-Registry -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection' -Name 'AllowTelemetry' -Value 0 -Type DWord 1361 | Set-Registry -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection' -Name 'MaxTelemetryAllowed' -Value 0 -Type DWord 1362 | Set-Registry -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection' -Name 'AllowTelemetry' -Value 0 -Type DWord 1363 | Write-Host "Windows: Telementry [DISABLED]" -ForegroundColor Green 1364 | 1365 | # Firewall Block 1366 | # Inbound - Check 1367 | $inboundRuleExists = Get-NetFirewallRule -DisplayName "Telementry Block - Inbound" -ErrorAction SilentlyContinue 1368 | # Inbound - Add 1369 | if (-not $inboundRuleExists) { 1370 | netsh advfirewall firewall add rule name="Telementry Block - Inbound" dir=in action=block remoteip=134.170.30.202,137.116.81.24,157.56.106.189,184.86.53.99,2.22.61.43,2.22.61.66,204.79.197.200,23.218.212.69,65.39.117.23,65.55.108.23,64.4.54.254 enable=yes 1371 | } 1372 | # Outbound - Check 1373 | $outboundRuleExists = Get-NetFirewallRule -DisplayName "Telementry Block - Outbound" -ErrorAction SilentlyContinue 1374 | # Outbound - Add 1375 | if (-not $outboundRuleExists) { 1376 | netsh advfirewall firewall add rule name="Telementry Block - Outbound" dir=out action=block remoteip=65.55.252.43,65.52.108.29,191.232.139.254,65.55.252.92,65.55.252.63,65.55.252.93,65.55.252.43,65.52.108.29,194.44.4.200,194.44.4.208,157.56.91.77,65.52.100.7,65.52.100.91,65.52.100.93,65.52.100.92,65.52.100.94,65.52.100.9,65.52.100.11,168.63.108.233,157.56.74.250,111.221.29.177,64.4.54.32,207.68.166.254,207.46.223.94,65.55.252.71,64.4.54.22,131.107.113.238,23.99.10.11,68.232.34.200,204.79.197.200,157.56.77.139,134.170.58.121,134.170.58.123,134.170.53.29,66.119.144.190,134.170.58.189,134.170.58.118,134.170.53.30,134.170.51.190,157.56.121.89,134.170.115.60,204.79.197.200,104.82.22.249,134.170.185.70,64.4.6.100,65.55.39.10,157.55.129.21,207.46.194.25,23.102.21.4,173.194.113.220,173.194.113.219,216.58.209.166,157.56.91.82,157.56.23.91,104.82.14.146,207.123.56.252,185.13.160.61,8.254.209.254,198.78.208.254,185.13.160.61,185.13.160.61,8.254.209.254,207.123.56.252,68.232.34.200,65.52.100.91,65.52.100.7,207.46.101.29,65.55.108.23,23.218.212.69 enable=yes 1377 | } 1378 | Write-Host "Windows: Telementry Internet Connection [DISABLED]" -ForegroundColor Green 1379 | #endregion 1380 | 1381 | 1382 | <#############################################################################################################################> 1383 | #region 8.0 - Space Cleanup 1384 | Write-Host "`n`n8.0 Space Cleanup" -ForegroundColor Green 1385 | Write-Host "8.1 User Files" -ForegroundColor Green 1386 | 1387 | # User 1388 | # User Profiles 1389 | $UserProfiles = Get-ChildItem "C:\Users" -Directory | Where-Object { 1390 | $_.Name -notin @("All Users","Default","Default User","Public") 1391 | } 1392 | 1393 | foreach ($UserProfile in $UserProfiles) { 1394 | Write-Host " - User Profiles" -ForegroundColor Green 1395 | <# 1396 | # Browsers 1397 | # IE / Edge 1398 | Remove-Item "$($UserProfile.FullName)\AppData\Local\Microsoft\Windows\INetCache\*" -Recurse -Force -ErrorAction SilentlyContinue 1399 | 1400 | # Chromium Edge 1401 | Get-ChildItem "$($UserProfile.FullName)\AppData\Local\Microsoft\Edge\User Data" -Directory -ErrorAction SilentlyContinue | 1402 | ForEach-Object { Remove-Item "$($_.FullName)\Cache\*" -Recurse -Force -ErrorAction SilentlyContinue } 1403 | 1404 | # Chrome 1405 | Get-ChildItem "$($UserProfile.FullName)\AppData\Local\Google\Chrome\User Data" -Directory -ErrorAction SilentlyContinue | 1406 | ForEach-Object { Remove-Item "$($_.FullName)\Cache\*" -Recurse -Force -ErrorAction SilentlyContinue } 1407 | 1408 | # Firefox 1409 | Get-ChildItem "$($UserProfile.FullName)\AppData\Local\Mozilla\Firefox\Profiles" -Directory -ErrorAction SilentlyContinue | 1410 | ForEach-Object { Remove-Item "$($_.FullName)\cache2\*" -Recurse -Force -ErrorAction SilentlyContinue } 1411 | #> 1412 | # Microsoft Store App 1413 | Remove-ItemRecursively -Path "$($UserProfile.FullName)\AppData\Local\Packages\*\TempState\*" 1414 | 1415 | # WebCache 1416 | Remove-ItemRecursively -Path "$($UserProfile.FullName)\AppData\Local\Microsoft\Windows\WebCache\*" 1417 | 1418 | # Crash Dumps 1419 | Remove-ItemRecursively -Path "$($UserProfile.FullName)\AppData\Local\CrashDumps\*" 1420 | 1421 | # Temp - User 1422 | Remove-ItemRecursively -Path "$($UserProfile.FullName)\Temp\*" 1423 | 1424 | # Temp - Local 1425 | Remove-ItemRecursively -Path "$($UserProfile.FullName)\AppData\Local\Temp\*" 1426 | 1427 | # Temp - Local Low 1428 | Remove-ItemRecursively -Path "$($UserProfile.FullName)\AppData\LocalLow\Temp\*" 1429 | 1430 | Write-Host " - Cleaned Profile: $($UserProfile.FullName)" -ForegroundColor Green 1431 | } 1432 | 1433 | # System 1434 | Write-Host "8.2 System Files" -ForegroundColor Green 1435 | # Error Reporting 1436 | Write-Host " - Clearing: Error Reporting Logs" -ForegroundColor Green 1437 | Remove-ItemRecursively -Path "C:\ProgramData\Microsoft\Windows\WER\*" 1438 | 1439 | # Prefetch 1440 | Write-Host " - Clearing: Prefetch Cache" -ForegroundColor Green 1441 | Remove-ItemRecursively -Path "C:\Windows\Prefetch\*" 1442 | 1443 | # Microsoft Store Cache 1444 | Write-Host " - Clearing: Microsot Store App Cache" -ForegroundColor Green 1445 | Remove-ItemRecursively -Path "C:\ProgramData\Microsoft\Windows\Caches\*" 1446 | 1447 | # Temporary Files 1448 | Write-Host " - Clearing: Temporary Files" -ForegroundColor Green 1449 | Remove-ItemRecursively -Path "C:\Windows\Temp\*" 1450 | Remove-ItemRecursively -Path "C:\Windows\ServiceProfiles\LocalService\AppData\Local\Temp\*" 1451 | Remove-ItemRecursively -Path "C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\*" 1452 | Remove-ItemRecursively -Path "C:\Windows\System32\config\systemprofile\AppData\Local\Temp\*" 1453 | 1454 | # Windows Update 1455 | Write-Host " - Clearing: Old/Unused Windows Updates" -ForegroundColor Green 1456 | # Windows Update - Stop 1457 | Stop-Service -Name wuauserv 1458 | 1459 | # SoftwareDistribution 1460 | if (Test-Path "C:\Windows\SoftwareDistribution.old") { 1461 | cmd.exe /c rd /s /q "C:\Windows\SoftwareDistribution.old" 1462 | } 1463 | Rename-Item -Path "C:\Windows\SoftwareDistribution" -NewName "SoftwareDistribution.old" 1464 | cmd.exe /c rd /s /q "C:\Windows\SoftwareDistribution.old" 1465 | 1466 | # Windows Update Internal Cache 1467 | Remove-ItemRecursively -Path "C:\Windows\SoftwareDistribution\EventCache.v2\*" 1468 | 1469 | # CBS (logs from Windows Update and DISM) 1470 | Remove-ItemRecursively -Path "C:\Windows\Logs\CBS\*" 1471 | 1472 | # DISM (operational logs) 1473 | Remove-ItemRecursively -Path "C:\Windows\Logs\DISM\*" 1474 | 1475 | # Setup/Upgrade Logs 1476 | Remove-ItemRecursively -Path "C:\Windows\Panther\*" 1477 | 1478 | # WinSxS (Service Pack Backups / Superseded Updates / Replaced Componets) 1479 | try { 1480 | Write-Host "`n*NOTE* This may take some time and is expected. Especially, if this is the first time running the script." -ForegroundColor Red 1481 | dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase 1482 | } catch { 1483 | Write-Warning "DISM cleanup failed: $_" 1484 | } 1485 | 1486 | # Windows.old 1487 | if (Test-Path "C:\Windows.old") { 1488 | cmd.exe /c rd /s /q "C:\Windows.old" 1489 | } 1490 | 1491 | # Windows Update - Start 1492 | Start-Service -Name wuauserv 1493 | 1494 | ## Free Space - Retrieve Updated Free Space 1495 | $FreeSpaceAfter = (Get-PSDrive -Name C).Free / 1GB 1496 | Write-Host "`n - Disk Space Free (after): $("{0:N2} GB" -f $FreeSpaceAfter)" -ForegroundColor Yellow 1497 | Write-Host " - Actual Space Freed: $("{0:N2} GB" -f ($FreeSpaceAfter - $FreeSpaceBefore))" -ForegroundColor Green 1498 | 1499 | 1500 | <#############################################################################################################################> 1501 | #region 9.0 - Script Status 1502 | Write-Host "`n`n9.0 Status: Ended at $(Get-Date)" -ForegroundColor Green 1503 | # Storage 1504 | Write-Host " - Storage" -ForegroundColor Yellow 1505 | Write-Host " - Drive Space Free [BEFORE]: $("{0:N2} GB" -f $FreeSpaceBefore)" 1506 | Write-Host " - Drive Space Free [AFTER]: $("{0:N2} GB" -f $FreeSpaceAfter)" 1507 | Write-Host " - Drive Space Restored: $("{0:N2} GB" -f ($FreeSpaceAfter - $FreeSpaceBefore))" 1508 | # Timer 1509 | Write-Host " - Timer" -ForegroundColor Yellow 1510 | $Timer.Stop() 1511 | $ElapsedTime = "{0:D2}:{1:D2}:{2:D2}" -f $Timer.Elapsed.Hours, $Timer.Elapsed.Minutes, $Timer.Elapsed.Seconds 1512 | Write-Host " - Elapsed Time: $ElapsedTime" 1513 | # Script 1514 | Write-Host " - Script" -ForegroundColor Yellow 1515 | Write-Host " - W1X Debloat Script | Version $sv" 1516 | Write-Host " - GitHub: https://github.com/AdminVin/W1X-Debloat " 1517 | 1518 | Write-Host "`n> > > PLEASE REBOOT YOUR COMPUTER FOR THE CHANGES TO TAKE EFFECT < < <`n" -ForegroundColor Red --------------------------------------------------------------------------------