├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── TROUBLESHOOTING.md ├── UWScript.ps1 └── autounattend.xml /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Updates 2 | 3 | ## 28/11/2024 4 | ### v2.1.0 Changes 5 | #### `autounattend.xml` Changes 6 | - Removed the forced Pro edition enforcement. This is so the answer file can still be used with Home and especially Enterprise versions like LTSC. 7 | - Added an order to temporarily disable all network adapters so Windows Updates aren't installed during the OOBE phase. (This should stop Windows Defender from being Enabled automatically.) 8 | - Added a FirstLogon command that enables the network adapter again when the first user loads in after the OOBE phase. 9 | 10 | #### `autounattend.xml` & `UWScript.ps1` Changes 11 | - Removed Microsoft Edge and Google Chrome Policies as it seems to negatively impact user browsing experience. 12 | - Defined a new list of services that should be set to Disabled and Manual as the original list in v2.0.0 caused issues. The process count isn't as low as before but Windows should be more functional. 13 | 14 | ## 1/11/2024 15 | - Released UnattendedWinstall v2.0.0 16 | 17 | ## 3/8/2024 18 | - Added Core version which disables Windows Defender. Specifically, it disables the following services "Sense, WdBoot, WdFilter, WdNisDrv, WdNisSvc, WinDefend" which in turns prevents the MsMpEng.exe process from running. Credit to Christoph Schneegans for explaining. 19 | - Combined 64bit, 32bit and ARM64 support into a single `autounattend.xml` file for each version of the file. 20 | - Fixed the `ei.cfg` file creation to correctly show all available editions of Windows during the setup. 21 | - User Account Control is now set to default (level 3) at the end of the `currentuser.cmd` script. 22 | - Set Powershell ExecutionPolicy to "AllSigned" for better security. Thanks https://github.com/cyb3rm4gus 23 | - Set "When Windows Detects Communication Activity" under "System > Sound > More sound settings > Communications" to "Do Nothing". Thanks https://github.com/MicaelJarniac 24 | - Added Blocks the “Allow my organization to manage my device” and “No, sign in to this app only” pop-up message. Thanks https://github.com/Syntax3rror404 25 | - Changed `NetworkThrottlingIndex` to 10 (Default) 26 | - Removed the "Disables Hibernation" entry. 27 | - Created `TROUBLESHOOTING.md` to provide fixes to common "issues." 28 | - Updated `README.md` for better readability and included more information and FAQ's. 29 | 30 | ## 24/7/2024 31 | *These Updates apply to ALL Versions* 32 | 33 | ### Changed 34 | README.md - Fixed wrong `ISO/Windows` folder creation in Method 3. (Can't create folders with "/") 35 | 36 | ``` 37 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v Wallpaper /t REG_SZ /d "C:\Windows\Web\Wallpaper\Windows\img19.jpg" /f 38 | ``` 39 | Changed img0.jpg to img19.jpg to compliment the automatic enabling of dark mode. 40 | 41 | ### Added 42 | ``` 43 | :: Disables Wallpaper JPEG Quality Reduction in Windows 10 44 | reg.exe add "HKEY_CURRENT_USER\Control Panel\Desktop" /v JPEGImportQuality /t REG_DWORD /d 100 /f 45 | ``` 46 | 47 | ``` 48 | :: Set Desktop Background Dark Mode Wallpaper 49 | reg.exe add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "C:\Windows\Web\Wallpaper\Windows\img19.jpg" /f 50 | ``` 51 | 52 | ### Removed 53 | Completely Removed `defaultuser.cmd` - It doesn't work as intended, registry settings are applied to user accounts via the `currentuser.cmd` script. 54 | 55 | ## 8/7/2024 56 | *These Updates apply to the Standard and IoT-LTSC-Like Versions* 57 | 58 | ### Changed 59 | ``` 60 | reg.exe add "HKEY_CURRENT_USER\Control Panel\Desktop" /v DragFullWindows /t REG_SZ /d 1 /f 61 | reg.exe add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ListviewAlphaSelect /t REG_DWORD /d 1 /f 62 | ``` 63 | Reason: Enabled these Settings for a more aesthetically pleasing Windows Experience. 64 | 65 | Added `` to all . 66 | 67 | ``` 68 | 69 | ``` 70 | Changes in the `specialize` phase 71 | - Added `-WindowStyle Hidden` to the powershell.exe commands to run the scripts minimized. (The Windows still appear briefly.) 72 | - Combined the `remove-caps.ps1`, `remove-features.ps1` scripts together into the `remove-packages.ps1` Script and changed the file path to `'C:\Windows\Setup\Scripts\remove-packages.ps1'`. 73 | - Changed the command for Run Chris Titus WinUtil Tweaks 74 | 75 | ### Added 76 | Added the following items to `wintweaks.ps1` 77 | ``` 78 | Dism /Online /Enable-Feature /FeatureName:NetFx3 /All /Source:X:\sources\sxs /LimitAccess 79 | ``` 80 | Reason: Auto-enables .NET Framework 3.5 (it's already a part of Windows) This fixes - https://github.com/memstechtips/UnattendedWinstall/issues/19 81 | 82 | ``` 83 | # Create WinUtil shortcut on the desktop (sourced from CTT MicroWin) 84 | $desktopPath = "C:\Users\Default\Desktop" 85 | # Specify the target PowerShell command 86 | $command = "powershell.exe -NoProfile -ExecutionPolicy Bypass -Command 'irm https://christitus.com/win | iex'" 87 | # Specify the path for the shortcut 88 | $shortcutPath = Join-Path $desktopPath 'LAUNCH-CTT-WINUTIL.lnk' 89 | # Create a shell object 90 | $shell = New-Object -ComObject WScript.Shell 91 | 92 | # Create a shortcut object 93 | $shortcut = $shell.CreateShortcut($shortcutPath) 94 | 95 | # Set properties of the shortcut 96 | $shortcut.TargetPath = "powershell.exe" 97 | $shortcut.Arguments = "-NoProfile -ExecutionPolicy Bypass -Command `"$command`"" 98 | # Save the shortcut 99 | $shortcut.Save() 100 | 101 | # Make the shortcut have 'Run as administrator' property on 102 | $bytes = [System.IO.File]::ReadAllBytes($shortcutPath) 103 | # Set byte value at position 0x15 in hex, or 21 in decimal, from the value 0x00 to 0x20 in hex 104 | $bytes[0x15] = $bytes[0x15] -bor 0x20 105 | [System.IO.File]::WriteAllBytes($shortcutPath, $bytes) 106 | ``` 107 | Reason: This fixes https://github.com/memstechtips/UnattendedWinstall/issues/30 where the CTT WinUtil didn't launch correctly. 108 | 109 | ``` 110 | 111 | 112 | 7 113 | cmd /c echo [Channel]>%SYSTEMDRIVE%\sources\ei.cfg && echo Retail>>%SYSTEMDRIVE%\sources\ei.cfg && echo [VL]>>%SYSTEMDRIVE%\sources\ei.cfg && echo 0>>%SYSTEMDRIVE%\sources\ei.cfg 114 | 115 | ``` 116 | Reason: Prevents auto detection of Windows Edition and forces Windows Setup to show all available Editions of Windows during setup. 117 | 118 | ``` 119 | :: Unpins all apps from the Start Menu 120 | reg.exe add "HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Start" /v ConfigureStartPins /t REG_SZ /d "{ \"pinnedList\": [] }" /f 121 | reg.exe add "HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Start" /v ConfigureStartPins_ProviderSet /t REG_DWORD /d 1 /f 122 | reg.exe add "HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Start" /v ConfigureStartPins_WinningProvider /t REG_SZ /d B5292708-1619-419B-9923-E5D9F3925E71 /f 123 | reg.exe add "HKLM\SOFTWARE\Microsoft\PolicyManager\providers\B5292708-1619-419B-9923-E5D9F3925E71\default\Device\Start" /v ConfigureStartPins /t REG_SZ /d "{ \"pinnedList\": [] }" /f 124 | reg.exe add "HKLM\SOFTWARE\Microsoft\PolicyManager\providers\B5292708-1619-419B-9923-E5D9F3925E71\default\Device\Start" /v ConfigureStartPins_LastWrite /t REG_DWORD /d 1 /f 125 | ``` 126 | Reason: Was previously removed (by mistake) - It cleans up the start menu. 127 | 128 | Added ARM versions of all files. This fixes https://github.com/memstechtips/UnattendedWinstall/issues/8 129 | 130 | ``` 131 | :: Disables User Account Control 132 | reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 0 /f 133 | ``` 134 | Reason: Without this entry, the `currentuser.cmd` file won't automatically run as Admin and some of the commands will fail. If you use UAC, just enable it in Control Panel. 135 | 136 | ### Removed 137 | ``` 138 | :: Hides the Language Switcher on the Taskbar 139 | reg.exe add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\CTF\LangBar" /v ShowStatus /t REG_DWORD /d 3 /f 140 | ``` 141 | Reason: Doesn't work. 142 | 143 | 144 | ## 30/6/2024 145 | ### Uploaded first edition of [IoT-LTSC-Like](https://github.com/memstechtips/UnattendedWinstall/blob/main/IoT-LTSC-Like/autounattend.xml) Answer File 146 | 147 | ### Removed 148 | ``` 149 | :: Start Menu Customizations 150 | :: Disables Recently Added Apps and Recommendations in the Start Menu 151 | reg.exe add "HKU\DefaultUser\Software\Policies\Microsoft\Windows\Explorer" /v HideRecentlyAddedApps /t REG_DWORD /d 1 /f 152 | reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Start_IrisRecommendations /t REG_DWORD /d 0 /f 153 | 154 | :: Start Menu Customizations 155 | :: Disables Recently Added Apps and Recommendations in the Start Menu 156 | reg.exe add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer" /v HideRecentlyAddedApps /t REG_DWORD /d 1 /f 157 | reg.exe add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Start_IrisRecommendations /t REG_DWORD /d 0 /f 158 | 159 | :: Start Menu Customization 160 | reg.exe add "HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Start" /v ConfigureStartPins /t REG_SZ /d "{ \"pinnedList\": [] }" /f 161 | reg.exe add "HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Start" /v ConfigureStartPins_ProviderSet /t REG_DWORD /d 1 /f 162 | reg.exe add "HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Start" /v ConfigureStartPins_WinningProvider /t REG_SZ /d B5292708-1619-419B-9923-E5D9F3925E71 /f 163 | reg.exe add "HKLM\SOFTWARE\Microsoft\PolicyManager\providers\B5292708-1619-419B-9923-E5D9F3925E71\default\Device\Start" /v ConfigureStartPins /t REG_SZ /d "{ \"pinnedList\": [] }" /f 164 | reg.exe add "HKLM\SOFTWARE\Microsoft\PolicyManager\providers\B5292708-1619-419B-9923-E5D9F3925E71\default\Device\Start" /v ConfigureStartPins_LastWrite /t REG_DWORD /d 1 /f 165 | :: Enables the "Settings" and "File Explorer" Icon in the Start Menu 166 | reg.exe add "HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Start" /v AllowPinnedFolderSettings /t REG_DWORD /d 00000001 /f 167 | reg.exe add "HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Start" /v AllowPinnedFolderSettings_ProviderSet /t REG_DWORD /d 00000001 /f 168 | reg.exe add "HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Start" /v AllowPinnedFolderFileExplorer /t REG_DWORD /d 00000001 /f 169 | reg.exe add "HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Start" /v AllowPinnedFolderFileExplorer_ProviderSet /t REG_DWORD /d 00000001 /f 170 | ``` 171 | Reason: Intended for Windows 11 but doesn't work as originally intended and prevents the user from changing the settings manually. 172 | 173 | ``` 174 | :: Disables User Account Control 175 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 0 /f 176 | 177 | :: Disables User Account Control 178 | reg.exe add "HKU\DefaultUser\SOFTWARE\Microsoft\Windows\CurrentVersion\Privacy" /v UserAccountControlSettings /t REG_DWORD /d 0 /f 179 | 180 | :: Disables User Account Control 181 | reg.exe add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Privacy" /v UserAccountControlSettings /t REG_DWORD /d 0 /f 182 | ``` 183 | Reason: Could cause security issues, user can set it manually. 184 | 185 | ### Added 186 | ``` 187 | 188 | 10 189 | Adds Take Ownership to the Right Click Context Menu 190 | cmd.exe /c "reg.exe import "C:\Windows\Setup\Scripts\take-ownership.reg" >>"C:\Windows\Setup\Scripts\take-ownership.log" 2>&1" 191 | 192 | ``` 193 | ``` 194 | 195 | 240 | 241 | ``` 242 | Reason: Useful Context Menu Entry to Quickly Take Ownership of Files and Folders 243 | 244 | ``` 245 | 246 | 00000-00000-00000-00000-00000 247 | Always 248 | 249 | ``` 250 | Reason: Prevents Windows from Automatically Selecting a Windows Edition due to a OEM key being installed in the BIOS/UEFI. 251 | 252 | ### Misc 253 | Update XML file so it is properly escaped and prevents errors. 254 | 255 | ## 29/6/2024 256 | ### Removed 257 | ``` 258 | Set-Service -Name 'wscsvc' -StartupType Manual -ErrorAction Continue 259 | ``` 260 | Reason: Could cause security issues 261 | 262 | Disables IPv6 263 | ``` 264 | New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters' -Name 'DisabledComponents' -PropertyType 'DWord' -Value 255 -Force 265 | Disable-NetAdapterBinding -Name "*" -ComponentID ms_tcpip6 266 | ``` 267 | Reason: Doesn't really provide any benefits. 268 | 269 | ### Added 270 | ``` 271 | :: Block Automatic Upgrade from Windows 10 22H2 to Windows 11 Although Manual Upgrade is Still Allowed - Credit CyberCPU Tech 272 | reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v "TargetReleaseVersion" /t REG_DWORD /d 1 /f 273 | reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v "TargetReleaseVersionInfo" /t REG_SZ /d "22H2" /f 274 | reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v "ProductVersion" /t REG_SZ /d "Windows 10" /f 275 | ``` 276 | ``` 277 | :: Disables Windows Recall on Copilot+ PC - Credit Britec09 278 | reg.exe add "HKU\DefaultUser\Software\Policies\Microsoft\Windows\WindowsAI" /f 279 | reg.exe add "HKU\DefaultUser\Software\Policies\Microsoft\Windows\WindowsAI" /v "DisableAIDataAnalysis" /t REG_DWORD /d 1 /f 280 | reg.exe add "HKU\DefaultUser\Software\Policies\Microsoft\Windows\Windows AI" /v "TurnOffSavingSnapshots" /t REG_DWORD /d 1 /f 281 | ``` 282 | ``` 283 | :: Disables Windows Recall on Copilot+ PC - Credit Britec09 284 | reg.exe add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\WindowsAI" /f 285 | reg.exe add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\WindowsAI" /v "DisableAIDataAnalysis" /t REG_DWORD /d 1 /f 286 | reg.exe add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Windows AI" /v "TurnOffSavingSnapshots" /t REG_DWORD /d 1 /f 287 | ``` 288 | 289 | ## 26/6/2024 290 | Updated description and changed Quality and Feature Updates delay to 365 days which is the maximum allowed period. 291 | 292 | ``` 293 | :: Sets Windows Update to Only Install Security Updates and Delay Other Updates for 1 Year 294 | reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v AUOptions /t REG_DWORD /d 3 /f 295 | reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferFeatureUpdates /t REG_DWORD /d 1 /f 296 | reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferFeatureUpdatesPeriodInDays /t REG_DWORD /d 365 /f 297 | reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferQualityUpdates /t REG_DWORD /d 1 /f 298 | reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferQualityUpdatesPeriodInDays /t REG_DWORD /d 365 /f 299 | ``` 300 | 301 | ## 23/6/2024 302 | 303 | Restore and Set Windows Photo Viewer as default image viewer. 304 | 305 | Updated following description: 306 | ``` 307 | :: Controls whether the memory page file is cleared at shutdown. Value 0 means it will not be cleared, speeding up shutdown. 308 | reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v ClearPageFileAtShutdown /t REG_DWORD /d 0 /f 309 | ``` 310 | 311 | ## 21/6/2024 312 | Removed the following entry as it removes the ability for the user to set a custom picture on the sign-in/lock screen and that wasn't my original purpose. 313 | 314 | *Disables the lock screen* 315 | 316 | *reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization" /v NoLockScreen /t REG_DWORD /d 1 /f* 317 | 318 | ## 20/6/2024 319 | Removed the following entry as it causes the legacy language bar to be displayed on the lock screen. 320 | 321 | *Hides the Language Switcher on the Taskbar* 322 | 323 | *Set-WinLanguageBarOption -UseLegacyLanguageBar* 324 | 325 | # Initial Release 15 June 2024 326 | ### Removed Preinstalled Bloatware Apps (remove-packages.ps1) 327 | The following preinstalled bloatware apps are removed during the Windows installation process: 328 | 329 | | Package Name | Name in Windows | 330 | |---------------------------------------------------|-----------------------------------------------| 331 | | `Microsoft.Microsoft3DViewer` | 3D Viewer | 332 | | `Microsoft.BingSearch` | Bing Search | 333 | | `Microsoft.WindowsCamera` | Camera | 334 | | `Clipchamp.Clipchamp` | Clipchamp | 335 | | `Microsoft.WindowsAlarms` | Alarms & Clock | 336 | | `Microsoft.549981C3F5F10` | Cortana | 337 | | `Microsoft.Windows.DevHome` | Dev Home | 338 | | `MicrosoftCorporationII.MicrosoftFamily` | Family Safety | 339 | | `Microsoft.WindowsFeedbackHub` | Feedback Hub | 340 | | `Microsoft.GetHelp` | Get Help | 341 | | `microsoft.windowscommunicationsapps` | Mail and Calendar | 342 | | `Microsoft.WindowsMaps` | Maps | 343 | | `Microsoft.ZuneVideo` | Movies & TV | 344 | | `Microsoft.BingNews` | News | 345 | | `Microsoft.WindowsNotepad` | Notepad | 346 | | `Microsoft.MicrosoftOfficeHub` | Office Hub | 347 | | `Microsoft.Office.OneNote` | OneNote | 348 | | `Microsoft.OutlookForWindows` | Outlook | 349 | | `Microsoft.Paint` | Paint | 350 | | `Microsoft.MSPaint` | Paint 3D | 351 | | `Microsoft.People` | People | 352 | | `Microsoft.Windows.Photos` | Photos | 353 | | `Microsoft.PowerAutomateDesktop` | Power Automate Desktop | 354 | | `MicrosoftCorporationII.QuickAssist` | Quick Assist | 355 | | `Microsoft.SkypeApp` | Skype | 356 | | `Microsoft.ScreenSketch` | Snip & Sketch | 357 | | `Microsoft.MicrosoftSolitaireCollection` | Solitaire Collection | 358 | | `Microsoft.MicrosoftStickyNotes` | Sticky Notes | 359 | | `MSTeams` | Teams | 360 | | `Microsoft.Getstarted` | Tips | 361 | | `Microsoft.Todos` | To Do | 362 | | `Microsoft.WindowsSoundRecorder` | Voice Recorder | 363 | | `Microsoft.BingWeather` | Weather | 364 | | `Microsoft.ZuneMusic` | Groove Music | 365 | | `Microsoft.WindowsTerminal` | Windows Terminal | 366 | | `Microsoft.Xbox.TCUI` | Xbox Console Companion | 367 | | `Microsoft.XboxApp` | Xbox | 368 | | `Microsoft.XboxGameOverlay` | Xbox Game Bar | 369 | | `Microsoft.XboxGamingOverlay` | Xbox Game Bar | 370 | | `Microsoft.XboxIdentityProvider` | Xbox Identity Provider | 371 | | `Microsoft.XboxSpeechToTextOverlay` | Xbox Speech To Text Overlay | 372 | | `Microsoft.GamingApp` | Xbox Game Pass | 373 | | `Microsoft.YourPhone` | Phone Link | 374 | | `Microsoft.MicrosoftEdge` | Microsoft Edge | 375 | | `Microsoft.MicrosoftEdge.Stable` | Microsoft Edge (Stable) | 376 | | `Microsoft.OneDrive` | OneDrive | 377 | | `Microsoft.MicrosoftEdgeDevToolsClient` | Microsoft Edge DevTools Client | 378 | | `Microsoft.549981C3F5F10` | Cortana (Duplicate) | 379 | | `Microsoft.MixedReality.Portal` | Mixed Reality Portal | 380 | | `Microsoft.Windows.Ai.Copilot.Provider` | Windows Copilot | 381 | | `Microsoft.WindowsMeetNow` | Meet Now | 382 | | `Microsoft.WindowsStore` | Microsoft Store | 383 | 384 | ### Removed Legacy Apps (remove-caps.ps1 & remove-features.ps1) 385 | | Package Name | Name in Windows | 386 | |-------------------------------------|-----------------------------------| 387 | | Browser.InternetExplorer | Internet Explorer | 388 | | MathRecognizer | Math Recognizer | 389 | | Microsoft.Windows.Notepad | Notepad | 390 | | OpenSSH.Client | OpenSSH Client | 391 | | Microsoft.Windows.MSPaint | Microsoft Paint | 392 | | Microsoft.Windows.PowerShell.ISE | PowerShell ISE | 393 | | App.Support.QuickAssist | Quick Assist | 394 | | App.StepsRecorder | Steps Recorder | 395 | | Media.WindowsMediaPlayer | Windows Media Player | 396 | | Microsoft.Windows.WordPad | WordPad | 397 | | Microsoft-SnippingTool | Snipping Tool | 398 | 399 | ### Registry Entries on Local Machine (localmachine.cmd) 400 | - Bypasses Microsoft Account Creation 401 | - Disables User Account Control 402 | - Disables the lock screen 403 | - Disable Windows Spotlight and set the normal Windows Picture as the desktop background 404 | - Disable Windows Spotlight on the lock screen 405 | - Disable Windows Spotlight suggestions, tips, tricks, and more on the lock screen 406 | - Disable Windows Spotlight on Settings 407 | - Set desktop background to a normal Windows picture 408 | - Ensure the wallpaper style is set to fill (2 is for fill, 10 is for fit) 409 | - Prevents Dev Home Installation 410 | - Prevents New Outlook for Windows Installation 411 | - Prevents Chat Auto Installation & Removes Chat Icon 412 | - Start Menu Customization 413 | - Enables the "Settings" and "File Explorer" Icon in the Start Menu 414 | - Enable Long File Paths with Up to 32,767 Characters 415 | - Disables News and Interests 416 | - Disables Windows Consumer Features Like App Promotions etc. 417 | - Disables Bitlocker Auto Encryption on Windows 11 24H2 and Onwards 418 | - Sets Windows Update to Only Install Security Updates and Delay Other Updates for 2 Years 419 | - Disables Cortana 420 | - Disables Activity History 421 | - Disables Hibernation 422 | - Disables Location Tracking 423 | - Disables Telemetry 424 | - Disables Windows Ink Workspace 425 | - Disables Feedback Notifications 426 | - Disables the Advertising ID for All Users 427 | - Disables Windows Error Reporting 428 | - Disables Delivery Optimization 429 | - Disables Remote Assistance 430 | - Search Windows Update for Drivers First 431 | - Gives Multimedia Applications like Games and Video Editing a Higher Priority 432 | - Clears Memory Page File at Shutdown 433 | - Enables NDU (Network Diagnostic Usage) Service on Startup 434 | - Increases IRP stack size to 30 for the LanmanServer service to Improve Network Performance and Stability 435 | - Hides the Meet Now Button on the Taskbar 436 | - Gives Graphics Cards a Higher Priority for Gaming 437 | - Gives the CPU a Higher Priority for Gaming 438 | - Gives Games a higher priority in the system's scheduling 439 | - Fix Managed by your organization in Edge 440 | - Set Registry Keys to Disable Wifi-Sense 441 | - Disables Storage Sense 442 | - Disable Xbox GameDVR 443 | - Disable Tablet Mode 444 | - Always go to desktop mode on sign-in 445 | - Disable "Use my sign-in info to automatically finish setting up my device after an update or restart" 446 | - Disables OneDrive Automatic Backups of Important Folders (Documents, Pictures etc.) 447 | - Disables the "Push To Install" feature in Windows 448 | - Disables Consumer Account State Content 449 | - Disables Cloud Optimized Content 450 | - Deletes Microsoft Edge Registry Entries 451 | - Deleting Application Compatibility Appraiser 452 | - Deleting Customer Experience Improvement Program 453 | - Deleting Program Data Updater 454 | - Deleting autochk proxy 455 | - Deleting QueueReporting 456 | 457 | ### Registry Entries for Default User and Current User (defaultuser.cmd & currentuser.cmd) 458 | - Disabling the Delivery of Personalized or Suggested Content Like App Suggestions, Tips, and Advertisements in Windows 459 | - Removes Copilot 460 | - Removes Store Banner in Notepad 461 | - Removes OneDrive 462 | - Align the taskbar to the left on Windows 11 463 | - Hides Search Icon on Taskbar 464 | - Disables Recently Added Apps and Recommendations in the Start Menu 465 | - Hides or Removes People from Taskbar 466 | - Hides Task View Button on Taskbar 467 | - Hides and Removes News and Interests from PC and Taskbar 468 | - Hides or Removes Notifications 469 | - Disables User Account Control 470 | - Disables User Account Sync 471 | - Disables Location Services 472 | - Disables Input Personalization Settings 473 | - Disables Automatic Feedback Sampling 474 | - Disables Recent Documents Tracking 475 | - Disable "Let websites provide locally relevant content by accessing my language list" 476 | - Disables "Let Windows track app launches to improve Start and search results" 477 | - Disables Background Apps 478 | - Disables App Diagnostics 479 | - Disables Delivery Optimization 480 | - Disables Tablet Mode 481 | - Disables Use Sign-In Info for User Account 482 | - Disables Maps Auto Download 483 | - Disables Telemetry and Ads 484 | - Manages and displays the status of ongoing operations, such as file copy, move, delete, etc. 485 | - Set File Explorer to Open This PC instead of Quick Access 486 | - Set Display for Performance 487 | - On Shutdown, Windows will automatically close any running applications 488 | - Sets the Mouse hover time to 400 milliseconds 489 | - Hides the Meet Now Button on the Taskbar 490 | - Disables the Second Out-Of-Box Experience 491 | - Set Display for Performance 492 | - Set Registry Keys to Enable End Task With Right Click 493 | - Disables Notification Tray and Calendar 494 | - Set Classic Right-Click Menu for Windows 11 495 | - Disable Xbox GameDVR 496 | - Disables Bing Search in Start Menu 497 | - Enables NumLock on Startup 498 | - Disables Mouse Acceleration 499 | - Disables Sticky Keys 500 | - Disables Snap Assist Flyout 501 | - Enables Show File Extensions 502 | - Enables Dark Mode 503 | - Hides the Language Switcher on the Taskbar 504 | - Makes Taskbar Transparent in Windows 10 505 | - Makes Taskbar Small in Windows 10 506 | - Don't Update Last Access Time Stamp - This Can Improve File System Performance 507 | 508 | ### Various Windows Tweaks (wintweaks.ps1) 509 | - Creates Desktop Shortcut for the Chris Titus Windows Utility So You Can Easily Launch it to Install Programs 510 | - Hides the Language Switcher on the Taskbar 511 | - Configure Maximum Password Age in Windows 512 | - Allow Execution of PowerShell Script Files 513 | - Groups or splits svchost.exe processes based on the amount of physical memory in the system to optimize performance 514 | - Removes Microsoft Edge 515 | - Removes OneDrive 516 | - Removes Microsoft Teams 517 | - Disables IPv6 518 | - Disables Telemetry 519 | - Disable Scheduled Tasks 520 | - Enable the Ultimate Performance power plan 521 | - Set the Ultimate Performance power plan as active 522 | - Set Services to Manual: 523 | - AJRouter 524 | - ALG 525 | - AppIDSvc 526 | - AppMgmt 527 | - AppReadiness 528 | - AppXSvc 529 | - Appinfo 530 | - AxInstSV 531 | - BDESVC 532 | - BITS 533 | - BthAvctpSvc 534 | - BthHFSrv 535 | - CDPSvc 536 | - CertPropSvc 537 | - ClipSVC 538 | - ConsentUxUserSvc_* 539 | - CoreMessagingRegistrar 540 | - CscService 541 | - DcpSvc 542 | - DevQueryBroker 543 | - DeviceAssociationBrokerSvc_* 544 | - DeviceAssociationService 545 | - DeviceInstall 546 | - DevicePickerUserSvc_* 547 | - DevicesFlowUserSvc_* 548 | - DispBrokerDesktopSvc 549 | - DisplayEnhancementService 550 | - DmEnrollmentSvc 551 | - DoSvc 552 | - DsSvc 553 | - DsmSvc 554 | - EFS 555 | - EapHost 556 | - EntAppSvc 557 | - FDResPub 558 | - Fax 559 | - FrameServer 560 | - FrameServerMonitor 561 | - GraphicsPerfSvc 562 | - HomeGroupListener 563 | - HomeGroupProvider 564 | - HvHost 565 | - IEEtwCollectorService 566 | - IKEEXT 567 | - InstallService 568 | - InventorySvc 569 | - IpxlatCfgSvc 570 | - LicenseManager 571 | - LxpSvc 572 | - MSDTC 573 | - MSiSCSI 574 | - MapsBroker 575 | - McpManagementService 576 | - MessagingService_* 577 | - MicrosoftEdgeElevationService 578 | - MixedRealityOpenXRSvc 579 | - MsKeyboardFilter 580 | - NPSMSvc_* 581 | - NaturalAuthentication 582 | - NcaSvc 583 | - NcbService 584 | - NcdAutoSetup 585 | - NetSetupSvc 586 | - NgcCtnrSvc 587 | - NgcSvc 588 | - NlaSvc 589 | - P9RdrService_* 590 | - PNRPAutoReg 591 | - PNRPsvc 592 | - PcaSvc 593 | - PerceptionSimulation 594 | - Pla 595 | - Seclogon 596 | - Shpamsvc 597 | - Smphost 598 | - Spectrum 599 | - Sppsvc 600 | - Ssh-agent 601 | - Svsvc 602 | - Swprv 603 | - TabletInputService 604 | - TapiSrv 605 | - TextInputManagementService 606 | - TimeBroker 607 | - TimeBrokerSvc 608 | - TokenBroker 609 | - TroubleshootingSvc 610 | - TrustedInstaller 611 | - UI0Detect 612 | - UdkUserSvc_* 613 | - UmRdpService 614 | - UnistoreSvc_* 615 | - UserDataSvc_* 616 | - UsoSvc 617 | - VaultSvc 618 | - W32Time 619 | - WEPHOSTSVC 620 | - WFDSConMgrSvc 621 | - WMPNetworkSvc 622 | - WManSvc 623 | - WPDBusEnum 624 | - WSService 625 | - WSearch 626 | - WaaSMedicSvc 627 | - WalletService 628 | - WarpJITSvc 629 | - WbioSrvc 630 | - Wcmsvc 631 | - WcsPlugInService 632 | - WdNisSvc 633 | - WdiServiceHost 634 | - WdiSystemHost 635 | - WebClient 636 | - Wecsvc 637 | - WerSvc 638 | - WiaRpc 639 | - WinHttpAutoProxySvc 640 | - WinRM 641 | - WlanSvc 642 | - WpcMonSvc 643 | - WpnService 644 | - WpnUserService_* 645 | - WwanSvc 646 | - XblAuthManager 647 | - XblGameSave 648 | - XboxGipSvc 649 | - XboxNetApiSvc 650 | - Autotimesvc 651 | - Bthserv 652 | - Camsvc 653 | - Cbdhsvc_* 654 | - Cloudidsvc 655 | 656 | # END 657 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Memory's Tech Tips (memstechtips) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UnattendedWinstall 2 | 3 | ## Introduction 4 | 5 | UnattendedWinstall leverages Microsoft's [Answer Files](https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/update-windows-settings-and-scripts-create-your-own-answer-file-sxs?view=windows-11) (or Unattend files) to automate and customize Windows installations.
It enables modifications to Windows Settings and Packages directly in the Windows ISO during setup. 6 | 7 | ### Why Use an Answer File? 8 | 9 | #### Security 10 | 11 | - Provides transparency by allowing inspection of all changes in the answer file. 12 | - Runs directly on official Windows ISOs from Microsoft, eliminating the need for unofficial sources. 13 | - Utilizes a Microsoft-supported feature designed for streamlined mass deployment of Windows installations. 14 | 15 | #### Automation 16 | 17 | - Enables automated configuration across multiple devices, saving time and effort by eliminating repetitive manual setups. 18 | 19 | > [!NOTE] 20 | > UnattendedWinstall has been tested and optimized for personal use. For those interested in customizing further, [create your own answer file](https://schneegans.de/windows/unattend-generator/) following [this video guide](https://youtu.be/WyLiJl-NQU8). 21 | 22 | ### Versions 23 | 24 | [![Version 2 Release (Latest)](https://img.shields.io/badge/Version-2.1.0%20Latest-0078D4?style=for-the-badge&logo=github&logoColor=white)](https://github.com/memstechtips/UnattendedWinstall/releases/tag/v2.1.0) 25 | [![Version 1 Release](https://img.shields.io/badge/Version-1.0.0-FFA500?style=for-the-badge&logo=github&logoColor=white)](https://github.com/memstechtips/UnattendedWinstall/releases/tag/v1.0.0) 26 | 27 | ### Support the Project 28 | 29 | If UnattendedWinstall has been useful to you, consider supporting the project, it really does help! 30 | 31 | [![Support via PayPal](https://img.shields.io/badge/Support-via%20PayPal-FFD700?style=for-the-badge&logo=paypal&logoColor=white)](https://paypal.me/memstech) 32 | 33 | ### Feedback and Community 34 | 35 | If you have feedback, suggestions, or need help with UnattendedWinstall, please feel free to join the discussion on GitHub or our Discord community: 36 | 37 | [![Join the Discussion](https://img.shields.io/badge/Join-the%20Discussion-2D9F2D?style=for-the-badge&logo=github&logoColor=white)](https://github.com/memstechtips/UnattendedWinstall/discussions) 38 | [![Join Discord Community](https://img.shields.io/badge/Join-Discord%20Community-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://www.discord.gg/zWGANV8QAX) 39 | 40 | ## Requirements 41 | 42 | - Windows 10 or Windows 11 43 | - *(Tested on Windows 10 22H2 & Windows 11 24H2)* 44 | - *(32-bit, 64-bit and arm64 is supported)* 45 | 46 | ## What Does UnattendedWinstall Do? 47 | 48 | The UnattendedWinstall answer file comes with detailed descriptions for nearly all configurations and registry tweaks, which are available for inspection here on GitHub. For customization, download the answer file and open it in editors like [Cursor](https://www.cursor.com/) or [VSCode](https://code.visualstudio.com/). 49 | 50 | ### Sources and Contributions 51 | 52 |
53 | Click to Show 54 | 55 | - **Base Answer File Generation**: 56 | - [Schneegans Unattend Generator](https://schneegans.de/windows/unattend-generator/) 57 | - **Tweaks & Optimizations**: 58 | - [ChrisTitusTech WinUtil](https://github.com/ChrisTitusTech/winutil) 59 | - [FR33THY's Ultimate Windows Optimization Guide](https://github.com/FR33THYFR33THY/Ultimate-Windows-Optimization-Guide) 60 | - **Additional Tweaks**: 61 | - [Tiny11Builder](https://github.com/ntdevlabs/tiny11builder) 62 | - [Ten Forums](https://www.tenforums.com/) 63 | - [Eleven Forum](https://www.elevenforum.com/) 64 | - [Winaero Tweaker](https://winaerotweaker.com/) 65 | 66 |
67 | 68 | ### Key Features 69 | 70 | - Ability to choose Windows Edition (Pro is not enforced anymore as in v2.0.0) 71 | - Bypasses Windows 11 system requirements 72 | - Disables Windows Defender services by default 73 | - *prompted to enable after Windows installation* 74 | - Disables User Account Control by default 75 | - *prompted to enable after Windows installation* 76 | - Allows execution of PowerShell scripts by default 77 | - Skips forced Microsoft account creation during Windows setup 78 | - Removes preinstalled bloatware apps except Microsoft Edge, Notepad and Calculator 79 | - Copilot and Recall is Disabled. 80 | - Sets privacy-related registry keys to disable telemetry 81 | - Limits Windows Update to install only security updates for one year 82 | - Optimizes registry with various optimization and customization-related keys 83 | - *See the "Set-RecommendedHKLMRegistry" and "Set-RecommendedHKCURegistry" functions for more information* 84 | - Disables unnecessary scheduled tasks 85 | - Configures Windows services for optimal performance 86 | - Enables the Ultimate Performance power plan 87 | 88 | > [!NOTE] 89 | > Use the `UWScript.ps1` file once Windows is installed to reapply or revert settings in case Windows Update resets some of the settings or if you encounter any issues. 90 | > It can also be used to achieve a similar experience to UnattendedWinstall on an existing Windows installation without reinstalling Windows. 91 | > 92 | > --- 93 | > 94 | > **Before Running the Script** 95 | > 96 | > Ensure you open PowerShell as an administrator. Additionally, set the execution policy to allow script execution by running the following command: 97 | > 98 | > ```powershell 99 | > Set-ExecutionPolicy Unrestricted 100 | > ``` 101 | > 102 | > Running PowerShell with elevated permissions and enabling script execution will ensure that `UWScript.ps1` can apply the necessary system changes. 103 | 104 | ## Usage Instructions 105 | 106 | To use an answer file, include `autounattend.xml` at the root of your Windows Installation Media to be executed during Windows setup. 107 | 108 | > [!IMPORTANT] 109 | > Ensure the answer file is named `autounattend.xml`; otherwise, it won’t be recognized by the installer. 110 | 111 | --- 112 | 113 | ### Using Memory's [WIMUtil](https://github.com/memstechtips/WIMUtil) (Highly Preferred) 114 | 115 | To use **WIMUtil**, follow these steps to launch PowerShell as an Administrator and run the installation script: 116 | 117 | 1. **Open PowerShell as Administrator:** 118 | - **Windows 10/11**: Right-click on the **Start** button and select **Windows PowerShell (Admin)** or **Windows Terminal (Admin)**.
PowerShell will open in a new window. 119 | 120 | 2. **Confirm Administrator Privileges**: 121 | - If prompted by the User Account Control (UAC), click **Yes** to allow PowerShell to run as an administrator. 122 | 123 | 3. **Paste and Run the Command**: 124 | - Copy the following command: 125 | ```powershell 126 | irm "https://github.com/memstechtips/WIMUtil/raw/main/src/WIMUtil.ps1" | iex 127 | ``` 128 | - To paste into PowerShell, **Right-Click** or press **Ctrl + V** in the PowerShell or Terminal window.
This should automatically paste your copied command. 129 | - Press **Enter** to execute the command. 130 | 131 | Once launched, **WIMUtil** guides you through a wizard: 132 | 133 | 1. **Select or Download Windows ISO** 134 | 2. **Add Latest UnattendedWinstall Answer File Automatically** 135 | 3. **Extract and Add Current Device Drivers to Installation Media** 136 | 4. **Create New ISO with Customizations Included** 137 | 5. **Create a Bootable USB Flash Drive with [Ventoy](https://github.com/ventoy/Ventoy)** 138 | 6. **Copy the New ISO File to the Ventoy Flash Drive** 139 | 7. **Boot from the USB flash drive, choose your ISO & Install Windows** 140 | 141 | For more info, check out the official [WIMUtil](https://github.com/memstechtips/WIMUtil) GitHub Repo. 142 | 143 | --- 144 | 145 | ### Old Methods 146 | #### Method 1: Create a Bootable Windows Installation USB 147 | 148 | - [Video Tutorial](https://youtu.be/pDEZDD_gEbo) 149 | 150 |
151 | Click to Show Instructions 152 | 153 | 1. Download the `autounattend.xml` file and save it on your computer. 154 | 2. Create a [Windows 10](https://www.microsoft.com/en-us/software-download/windows10) or [Windows 11](https://www.microsoft.com/en-us/software-download/windows11) Bootable Installation USB drive with [Rufus](https://rufus.ie/en/) or the Media Creation Tool. 155 | 156 | > **Important** 157 | > - Some users have reported issues with the Media Creation Tool when creating the Windows Installation USB. Use it at your own discretion. 158 | > - When using Rufus, don’t select any of the checkboxes in “Customize Your Windows Experience,” as it creates another `autounattend.xml` file that might overwrite settings in the UnattendedWinstall file. 159 | 160 | 3. Copy the `autounattend.xml` file you downloaded in Step 1 to the root of the Bootable Windows Installation USB you created in Step 2. 161 | 4. Boot from the Windows Installation USB, do a clean install of Windows as normal, and the scripts will run automatically. 162 | 163 |
164 | 165 | #### Method 2: Create a Custom ISO File 166 | 167 | - [Video Tutorial](https://youtu.be/pDEZDD_gEbo?si=ChEGghEOLCyLSnp7&t=1117) 168 | 169 |
170 | Click to Show Instructions 171 | 172 | 1. Download the `autounattend.xml` file and save it on your computer. 173 | 2. Download the [Windows 10](https://www.microsoft.com/en-us/software-download/windows10) or [Windows 11](https://www.microsoft.com/en-us/software-download/windows11) ISO file depending on the version you want. 174 | 3. Download and install [AnyBurn](https://anyburn.com/download.php) 175 | - In AnyBurn, select the “Edit Image File” option. 176 | - Navigate to and select the Official Windows ISO file you downloaded in Step 2. 177 | - Click on “Add” and select the `autounattend.xml` file you downloaded in Step 1, or just click and drag the `autounattend.xml` into the AnyBurn window. 178 | - Click on “Next,” then on “Create Now.” You should be prompted to overwrite the ISO file; click on “Yes.” 179 | - Once the process is complete, close AnyBurn. 180 | 4. Use the ISO file to install Windows on a Virtual Machine OR use a program like [Rufus](https://rufus.ie/en/) or [Ventoy](https://github.com/ventoy/Ventoy) to create a bootable USB flash drive with the edited Windows ISO file. 181 | 182 | > **Important** 183 | > 184 | > - When using Rufus, don’t select any of the checkboxes in “Customize Your Windows Experience,” as it creates another `autounattend.xml` file that might overwrite settings in the UnattendedWinstall file. 185 | 186 | 5. Boot from the Windows Installation USB, do a clean install of Windows as normal, and the scripts will run automatically. 187 | 188 |
189 | 190 | #### Method 3: Use Ventoy Auto Install Plugin 191 | 192 | - [Video Tutorial](https://youtu.be/4AGZQJTyCOs) 193 | 194 |
195 | Click to Show Instructions 196 | 197 | 1. Download the `autounattend.xml` file and save it on your computer. 198 | 2. Download the [Windows 10](https://www.microsoft.com/en-us/software-download/windows10) or [Windows 11](https://www.microsoft.com/en-us/software-download/windows11) ISO file, depending on the version you want. 199 | 3. Download and install [Ventoy](https://github.com/ventoy/Ventoy) to your desired USB flash drive. 200 | 4. Prepare the folder structure: 201 | - In your newly created Ventoy USB disk, create the following folders: `ISO` and `Templates`.
*They should be at the root of the drive.* 202 | - Inside of the `ISO` folder, create a new folder called `Windows`. 203 | - Copy your Windows ISO files in the `ISO\Windows` folder. 204 | - Copy your `autounattend.xml` into the `Templates` folder. 205 | 5. Start VentoyPlugson. Depending on your OS, the steps might differ. 206 | - On Windows, run the `VentoyPlugson.exe` file. 207 | - A new browser window should open up with a Ventoy web interface ready to go. 208 | - Select the `Auto Install Plugin` menu from the list. 209 | - Click on the `Add` button. 210 | - Select [parent] to make the whole Windows ISO folder benefit from the plugin. 211 | - In the Directory Path, paste in the absolute path to your `Windows` folder.
example: `F:\ISO\Windows` (Replace `F` with your drive letter.) 212 | - In the Template Path, paste in the absolute path to your `autounattend.xml` file.
example: `F:\Templates\autounattend.xml` (Replace `F` with your drive letter.)
(PSA: If you have more `autounattend.xml` files, you can add them later on!) 213 | - Click on `OK` and you should see a message saying that the configuration has been saved successfully. 214 | - Close the VentoyPlugson browser window and stop the VentoyPlugson application. 215 | 6. Boot from the Ventoy USB drive in the computer where you want to install windows. 216 | - After selecting a Windows ISO to boot from, you will be prompted to boot with the `/Templates/autounattend.xml` file. 217 | - Select that option and the `autounattend.xml` will be automatically executed during installation. 218 | 219 |
220 | 221 | ## FAQ 222 | 223 | ### How can I apply these settings to an existing Windows installation? 224 | 225 | - Run the [`UWScript.ps1`](https://github.com/memstechtips/UnattendedWinstall/blob/main/UWScript.ps1) file or use the [Chris Titus Tech Windows Utility](https://github.com/ChrisTitusTech/winutil) ([Video](https://youtu.be/pldFPTnOCGM)). 226 | 227 | ### Can this answer file be used for an in-place upgrade? 228 | 229 | - No, in-place upgrades do not support answer files. 230 | 231 | ### Why is Windows still updating automatically? 232 | 233 | - Feature updates are delayed for a year; however, security and driver updates continue as usual. 234 | 235 | ### Why don't I have internet after installing Windows? 236 | 237 |
238 | Click to Show Instructions 239 | 240 | If you’re unable to connect to the internet after installation, it’s likely because your Wi-Fi or LAN (Ethernet) drivers are missing. Windows sometimes doesn’t include all necessary drivers for network adapters, especially if they’re specific to your device. 241 | 242 | To resolve this, follow these steps: 243 | 244 | 1. **Download your network driver** from the manufacturer’s website on another computer with internet access. Look for Wi-Fi or LAN drivers specific to your device model. 245 | 2. **Transfer the driver** to your Windows installation via USB drive. 246 | 3. **Install the driver** on your Windows system and restart if necessary. 247 | 248 | After installation, you should be able to connect to the internet. 249 | 250 |
251 | 252 | ### How can I access the previous "IoT-LTSC-Like," "Standard," and "Core" versions of the file(s)? 253 | 254 | - You still have access to the previous files here: [Version 1.0.0 Release](https://github.com/memstechtips/UnattendedWinstall/releases/tag/v1.0.0). 255 | 256 | > [!NOTE] 257 | > You need to download the `Source Code.zip` file. Once extracted, you’ll have access to all the previous v1.0.0 files. 258 | 259 | ### Why isn't Microsoft Edge Uninstalled? 260 | 261 |
262 | Click to Show Explanation 263 | 264 | I spent a lot of time trying to find a way to uninstall Microsoft Edge during Windows installation. However, it was challenging because of differences between Windows 10 22H2 and Windows 11 24H2. My goal is to use Microsoft’s supported uninstall methods, and I plan to add an easy Edge removal option in future releases. 265 | 266 | In the meantime, if you wish to remove Edge after Windows installation, consider using [this script by FR33THY](https://github.com/FR33THYFR33THY/Ultimate-Windows-Optimization-Guide/blob/main/6%20Windows/14%20Edge.ps1). FR33THY’s *Ultimate Windows Optimization Guide* was a major inspiration for version 2.0.0 of this project, and I highly recommend exploring it for additional Windows optimization tips. 267 | 268 |
269 | 270 | ### How can I add my own Registry Tweaks to v2.0.0 of the `autounattend.xml` file? 271 | 272 |
273 | Click to Show Instructions 274 | 275 | You can also still add your own registry entries to the v2.0.0 file, and it is actually easier if you understand where to add it. I'll give a brief explanation. 276 | 277 | For registry entries that apply to the local machine, i.e., `HKEY_LOCAL_MACHINE` registry keys, you can find the `function SetRecommendedHKLMRegistry` in the `autounattend.xml` file, see here: https://github.com/memstechtips/UnattendedWinstall/blob/93305192ed6d64e0f5b98a89f447927480285354/autounattend.xml#L1981 278 | 279 | and then add whatever registry entries you want to add in `.reg` format, like the rest of the entries are set, and just make sure you add it before the `"@` to make it part of the `.reg` file that will be generated, see here: https://github.com/memstechtips/UnattendedWinstall/blob/93305192ed6d64e0f5b98a89f447927480285354/autounattend.xml#L3412 280 | 281 | and it will then be applied to the registry. 282 | 283 | Similarly, if you have `HKEY_CURRENT_USER` registry keys, you can add those to the `User Customization.ps1` file in the same way as explained above, starting here: 284 | https://github.com/memstechtips/UnattendedWinstall/blob/93305192ed6d64e0f5b98a89f447927480285354/autounattend.xml#L3912 285 | so below the `Windows Registry Editor Version 5.00` and then ending before the `"@` here: https://github.com/memstechtips/UnattendedWinstall/blob/93305192ed6d64e0f5b98a89f447927480285354/autounattend.xml#L4423 286 | 287 | > **Note** 288 | > The above links might not take you to the correct lines of code once new versions of the file are released, but it does take you to the correct lines on v2.0.0. 289 | 290 |
291 | 292 | 293 | -------------------------------------------------------------------------------- /TROUBLESHOOTING.md: -------------------------------------------------------------------------------- 1 | # Troubleshooting Guides 2 | *For UnattendedWinstall v1.0.0* 3 | 4 | ## Adobe Creative Cloud Installer won't Launch 5 | 6 |
7 | Click to Show Fix 8 | 9 | ### You need to install Microsoft Edge 10 | 11 | 1. Right-Click on Start and open Windows Powershell or Terminal as Admin. 12 | 2. Run the following command: 13 | ```powershell 14 | irm www.christitus.com/win | iex 15 | ``` 16 | 3. Select Microsoft Edge and Click on "Install or Upgrade Selected." 17 | 4. Microsoft Edge will be reinstalled. 18 | 5. After Edge is installed, navigate to `C:\Program Files (x86)\Microsoft\Edge\Application` and run the `msedge.exe` file to launch Edge and create a Desktop Shortcut. 19 | 20 | **Alternatively:** 21 | 22 | 1. Right-Click on Start and open Windows Powershell or Terminal as Admin. 23 | 2. Run the following command: 24 | ```powershell 25 | winget install -e --id Microsoft.Edge 26 | ``` 27 | 3. Microsoft Edge will be reinstalled. 28 | 4. After Edge is installed, navigate to `C:\Program Files (x86)\Microsoft\Edge\Application` and run the `msedge.exe` file to launch Edge and create a Desktop Shortcut. 29 | 30 |
31 | 32 | ## OneDrive not Launching 33 | 34 |
35 | Click to Show Fix 36 | 37 | ### You need to Enable OneDrive and User Sync 38 | 39 | 1. Right-Click on Start and open Windows Powershell or Terminal as Admin. 40 | 2. Run the following commands: 41 | ```powershell 42 | reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\OneDrive" /v KFMBlockOptIn /t REG_DWORD /d 0 /f 43 | reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\OneDrive" /v DisableFileSyncNGSC /t REG_DWORD /d 0 /f 44 | reg.exe add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Privacy" /v SettingSyncEnabled /t REG_DWORD /d 1 /f 45 | ``` 46 | 3. Restart Your PC and try launching OneDrive again. 47 | 48 |
49 | 50 | ## Calendar and Notifications (WhatsApp) not Working 51 | 52 |
53 | Click to Show Fix 54 | 55 | ### You need to Enable the Calendar, Notifications and Background Apps 56 | 57 | 1. Right-Click on Start and open Windows Powershell or Terminal as Admin. 58 | 2. Run the following commands: 59 | ```powershell 60 | reg.exe add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer" /v DisableNotificationCenter /t REG_DWORD /d 0 /f 61 | reg.exe add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\PushNotifications" /v ToastEnabled /t REG_DWORD /d 1 /f 62 | reg.exe add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" /v GlobalUserDisabled /t REG_DWORD /d 0 /f 63 | ``` 64 | 3. Restart Your PC to apply the changes. 65 | 66 |
67 | 68 | ## Windows Spotlight not Working 69 | 70 |
71 | Click to Show Fix 72 | 73 | ### You need to Enable Windows Spotlight 74 | 75 | 1. Right-Click on Start and open Windows Powershell or Terminal as Admin. 76 | 2. Run the following commands: 77 | ```powershell 78 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v DisableWindowsSpotlightOnLockScreen /t REG_DWORD /d 0 /f 79 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v DisableWindowsConsumerFeatures /t REG_DWORD /d 0 /f 80 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v DisableWindowsSpotlightActiveUser /t REG_DWORD /d 0 /f 81 | ``` 82 | 3. Restart Your PC to apply the changes. 83 | 84 |
85 | 86 | 87 | ## How to Reinstall the Microsoft Store 88 | 89 |
90 | Click to Show Fix 91 | 92 | ### Reinstall the Microsoft Store - [Video Instructions](https://youtu.be/pjPtV_1cVOk) 93 | 94 | 1. Download, Install and Launch the [Xbox App for Windows](https://www.xbox.com/en-US/apps/xbox-app-for-pc) 95 | 2. It will prompt you to install missing dependencies and the Microsoft Store is one of them. 96 | 97 |
98 | 99 | ## Xbox Game Bar not Working or Recording 100 | 101 |
102 | Click to Show Fix 103 | 104 | ### Install the Xbox App for Windows and Enable the Xbox Game Bar 105 | 106 | 1. Download, Install and Launch the [Xbox App for Windows](https://www.xbox.com/en-US/apps/xbox-app-for-pc) 107 | 2. It will prompt you to install missing dependencies, install all of them. 108 | 3. Right-Click on Start and open Windows Powershell or Terminal as Admin. 109 | 4. Run the following commands: 110 | ```powershell 111 | reg.exe add "HKEY_CURRENT_USER\System\GameConfigStore" /v GameDVR_FSEBehavior /t REG_DWORD /d 0 /f 112 | reg.exe add "HKEY_CURRENT_USER\System\GameConfigStore" /v GameDVR_Enabled /t REG_DWORD /d 1 /f 113 | reg.exe add "HKEY_CURRENT_USER\System\GameConfigStore" /v GameDVR_DXGIHonorFSEWindowsCompatible /t REG_DWORD /d 0 /f 114 | reg.exe add "HKEY_CURRENT_USER\System\GameConfigStore" /v GameDVR_HonorUserFSEBehaviorMode /t REG_DWORD /d 0 /f 115 | reg.exe add "HKEY_CURRENT_USER\System\GameConfigStore" /v GameDVR_EFSEFeatureFlags /t REG_DWORD /d 1 /f 116 | reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\GameDVR" /v AllowGameDVR /t REG_DWORD /d 1 /f 117 | ``` 118 | 5. Restart Your PC to apply the changes. 119 | 120 |
121 | 122 | 123 | -------------------------------------------------------------------------------- /UWScript.ps1: -------------------------------------------------------------------------------- 1 | # Check if script is running as Administrator 2 | If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator")) { 3 | Try { 4 | Start-Process PowerShell.exe -ArgumentList ("-NoProfile -ExecutionPolicy Bypass -File `"{0}`"" -f $PSCommandPath) -Verb RunAs 5 | Exit 6 | } 7 | Catch { 8 | Write-Host "Failed to run as Administrator. Please rerun with elevated privileges." 9 | Exit 10 | } 11 | } 12 | 13 | # Set window title and color scheme 14 | $Host.UI.RawUI.WindowTitle = $myInvocation.MyCommand.Definition + " (Administrator)" 15 | $Host.UI.RawUI.BackgroundColor = "Black" 16 | $Host.PrivateData.ProgressBackgroundColor = "Black" 17 | $Host.PrivateData.ProgressForegroundColor = "White" 18 | Clear-Host 19 | 20 | # Center the PowerShell window 21 | $psWindow = Get-Process -Id $pid | ForEach-Object { $_.MainWindowHandle } 22 | Add-Type @" 23 | using System; 24 | using System.Runtime.InteropServices; 25 | public class WindowCentering { 26 | [DllImport("user32.dll", SetLastError = true)] 27 | public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect); 28 | 29 | [DllImport("user32.dll", SetLastError = true)] 30 | public static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint); 31 | 32 | [StructLayout(LayoutKind.Sequential)] 33 | public struct RECT { 34 | public int Left; 35 | public int Top; 36 | public int Right; 37 | public int Bottom; 38 | } 39 | 40 | public static void CenterWindow(IntPtr hWnd) { 41 | RECT rect; 42 | GetWindowRect(hWnd, out rect); 43 | int windowWidth = rect.Right - rect.Left; 44 | int windowHeight = rect.Bottom - rect.Top; 45 | 46 | int screenWidth = GetSystemMetrics(0); 47 | int screenHeight = GetSystemMetrics(1); 48 | 49 | int x = (screenWidth / 2) - (windowWidth / 2); 50 | int y = (screenHeight / 2) - (windowHeight / 2); 51 | 52 | MoveWindow(hWnd, x, y, windowWidth, windowHeight, true); 53 | } 54 | 55 | [DllImport("user32.dll")] 56 | public static extern int GetSystemMetrics(int nIndex); 57 | } 58 | "@ 59 | 60 | [WindowCentering]::CenterWindow($psWindow) 61 | 62 | # START OF MENU FUNCTIONS 63 | $script:loop = $true 64 | 65 | # Header 66 | function Show-Header { 67 | Clear-Host 68 | Write-Host "============================================" -ForegroundColor Cyan 69 | Write-Host " UWScript " -ForegroundColor Yellow 70 | Write-Host "============================================" -ForegroundColor Cyan 71 | Write-Host "" 72 | Write-Host "NO LIABILITY ACCEPTED, PROCEED WITH CAUTION!" -ForegroundColor Black -BackgroundColor Red 73 | Write-Host "" 74 | } 75 | 76 | # Main Menu 77 | function Show-MainMenu { 78 | Show-Header 79 | Write-Host "Main Menu:" -ForegroundColor Yellow 80 | Write-Host "1. Software & Apps" 81 | Write-Host "2. Privacy & Security" 82 | Write-Host "3. Windows Updates" 83 | Write-Host "4. Optimize Registry" 84 | Write-Host "5. Tasks & Services" 85 | Write-Host "6. Power Settings" 86 | Write-Host "0. Exit" 87 | 88 | $choice = Read-Host "Select an option (0-6)" 89 | 90 | switch ($choice) { 91 | "1" { Show-SoftwareMenu } # Call the Software & Apps menu 92 | "2" { Show-PrivacySecurityMenu } # Call the Privacy & Security menu 93 | "3" { Show-WindowsUpdateMenu } # Call the Windows Updates menu 94 | "4" { Show-OptimizeRegistryMenu } # Call the Optimize Registry menu 95 | "5" { Show-TasksServicesMenu } # Call the Tasks & Services menu 96 | "6" { Show-PowerSettingsMenu } # Call the Power Settings menu 97 | "0" { $script:loop = $false } # Exit 98 | default { 99 | Write-Host "Invalid selection. Please try again." -ForegroundColor Red 100 | Start-Sleep -Seconds 1 101 | } 102 | } 103 | } 104 | 105 | # Reusable Menu Function 106 | function Show-Menu { 107 | param ( 108 | [string]$menuTitle, 109 | [string[]]$options, 110 | [hashtable]$actions, 111 | [string]$instructions = "Select an option", 112 | [switch]$showHeader 113 | ) 114 | 115 | # Display the header if specified 116 | if ($showHeader) { 117 | Show-Header 118 | } 119 | 120 | # Display the menu title 121 | Write-Host "$menuTitle" -ForegroundColor Yellow 122 | 123 | # Display the "Back" option as "0" 124 | Write-Host "0. Main Menu" -ForegroundColor Cyan 125 | 126 | # Display the options starting from 1 127 | for ($i = 0; $i -lt $options.Length; $i++) { 128 | Write-Host "$($i + 1). $($options[$i])" 129 | } 130 | 131 | Write-Host "" 132 | $choice = Read-Host "$instructions" 133 | 134 | if ($choice -eq "0") { 135 | return # Return to the previous menu or exit current menu 136 | } 137 | elseif ($actions.ContainsKey($choice)) { 138 | # Execute the corresponding action 139 | & $actions[$choice] 140 | } 141 | else { 142 | Write-Host "Invalid choice. Try again." -ForegroundColor Red 143 | Start-Sleep -Seconds 1 144 | Show-Menu -menuTitle $menuTitle -options $options -actions $actions -showHeader:$showHeader 145 | } 146 | } 147 | 148 | 149 | # 1. Software & Apps Menu 150 | function Show-SoftwareMenu { 151 | Show-Menu -menuTitle "Software & Apps" ` 152 | -options @("Install Software", "Remove Bloatware Apps") ` 153 | -actions @{ 154 | "1" = { Show-AppInstallMenu } 155 | "2" = { Show-AppRemovalMenu } 156 | } ` 157 | -showHeader 158 | } 159 | 160 | # Install Software Menu 161 | function Show-AppInstallMenu { 162 | Show-Menu -menuTitle "Select an app to install" ` 163 | -options @("Microsoft Store", "Browser Menu", "UniGetUI (Software Manager)") ` 164 | -actions @{ 165 | "1" = { Install-Store } 166 | "2" = { Show-BrowserInstallMenu } 167 | "3" = { Install-AppWithWinGet -AppName "MartiCliment.UniGetUI" -FriendlyName "UniGetUI (Software Manager)" } 168 | } ` 169 | -showHeader 170 | } 171 | function Show-BrowserInstallMenu { 172 | Show-Menu -menuTitle "Select a Browser to install" ` 173 | -options @("Thorium Browser", "Mozilla Firefox", "Microsoft Edge", "Google Chrome", "Brave Browser") ` 174 | -actions @{ 175 | "1" = { Install-AppWithWinGet -AppName "Alex313031.Thorium" -FriendlyName "Thorium Browser" } 176 | "2" = { Install-AppWithWinGet -AppName "Mozilla.Firefox" -FriendlyName "Mozilla Firefox" } 177 | "3" = { Install-AppWithWinGet -AppName "Microsoft.Edge" -FriendlyName "Microsoft Edge" } 178 | "4" = { Install-AppWithWinGet -AppName "Google.Chrome" -FriendlyName "Google Chrome" } 179 | "5" = { Install-AppWithWinGet -AppName "Brave.Brave" -FriendlyName "Brave Browser" } 180 | } ` 181 | -showHeader 182 | } 183 | 184 | # Remove Bloatware Apps Menu 185 | function Show-AppRemovalMenu { 186 | Show-Menu -menuTitle "Remove Windows Bloatware Apps" ` 187 | -options @("Remove ALL Windows Apps") ` 188 | -actions @{ 189 | "1" = { Remove-Apps } 190 | } ` 191 | -showHeader 192 | } 193 | 194 | # 2. Privacy & Security Menu 195 | function Show-PrivacySecurityMenu { 196 | Show-Menu -menuTitle "Privacy & Security" ` 197 | -options @("Check Windows Defender Status", "Check User Account Control Status", "Apply Recommended Privacy Settings", "Apply Windows Default Privacy Settings") ` 198 | -actions @{ 199 | "1" = { Get-WindowsDefenderStatus } 200 | "2" = { Get-UACStatus } 201 | "3" = { Set-RecommendedPrivacySettings } 202 | "4" = { Set-DefaultPrivacySettings } 203 | } ` 204 | -showHeader 205 | } 206 | 207 | # 3. Windows Updates Menu 208 | function Show-WindowsUpdateMenu { 209 | Show-Menu -menuTitle "Windows Update Settings" ` 210 | -options @("Set Recommended Update Settings", "Set Default Update Settings") ` 211 | -actions @{ 212 | "1" = { Set-RecommendedUpdateSettings } 213 | "2" = { Set-DefaultUpdateSettings } 214 | } ` 215 | -showHeader 216 | } 217 | 218 | # 4. Optimize Registry Menu 219 | function Show-OptimizeRegistryMenu { 220 | Show-Menu -menuTitle "Optimize Windows Registry" ` 221 | -options @("Set Recommended Registry Settings", "Set Default Registry Settings") ` 222 | -actions @{ 223 | "1" = { Set-RecommendedHKLMRegistry; Set-RecommendedHKCURegistry } 224 | "2" = { Set-DefaultHKLMRegistry; Set-DefaultHKCURegistry } 225 | } ` 226 | -showHeader 227 | } 228 | 229 | # 5. Tasks & Services Menu 230 | function Show-TasksServicesMenu { 231 | Show-Menu -menuTitle "Windows Services & Scheduled Tasks" ` 232 | -options @("Minimal Services", "Default Services", "Disable Scheduled Tasks", "Enable Scheduled Tasks") ` 233 | -actions @{ 234 | "1" = { Set-ServiceStartup } 235 | "2" = { Set-DefaultServices } 236 | "3" = { Disable-ScheduledTasks } 237 | "4" = { Enable-ScheduledTasks } 238 | } ` 239 | -showHeader 240 | } 241 | 242 | # 6. Power Settings Menu 243 | function Show-PowerSettingsMenu { 244 | Show-Menu -menuTitle "Power Settings" ` 245 | -options @("Recommended Power Settings", "Default Power Settings") ` 246 | -actions @{ 247 | "1" = { Set-RecommendedPowerSettings } 248 | "2" = { Set-DefaultPowerSettings } 249 | } ` 250 | -showHeader 251 | } 252 | 253 | # END OF MENU FUNCTIONS 254 | 255 | # Define Unattended Windows Installation Variables & Functions 256 | # Check if the marker file exists to determine if we are in the specialize phase 257 | $markerFilePath = "C:\specialize_marker.txt" 258 | $isSpecializePhase = Test-Path $markerFilePath 259 | # Function to Pause scripts only when not in Specialize Phase 260 | function Wait-IfNotSpecialize { 261 | if (-not $isSpecializePhase) { 262 | Pause 263 | } 264 | } 265 | 266 | # START OF COMMAND & OPERATION FUNCTIONS 267 | # Start of Software & Apps Functions 268 | # Install Software Functions 269 | 270 | # Check for internet connection 271 | function Test-InternetConnection { 272 | Try { 273 | $connection = Test-Connection -ComputerName www.microsoft.com -Count 1 -ErrorAction Stop 274 | if ($connection) { 275 | return $true 276 | } 277 | } 278 | Catch { 279 | return $false 280 | } 281 | } 282 | 283 | # Install the Microsoft Store 284 | function Install-Store { 285 | Clear-Host 286 | # Check for internet connection 287 | if (-not (Test-InternetConnection)) { 288 | Write-Host "No internet connection detected. Please connect to the internet and try again." -BackgroundColor Red 289 | Wait-IfNotSpecialize 290 | return 291 | } 292 | 293 | # If internet connection is available, continue with installation 294 | Show-Header 295 | Write-Host "Installing Microsoft Store . . ." 296 | Try { 297 | wsreset -i -ErrorAction SilentlyContinue 298 | Show-Header 299 | Write-Host "Microsoft Store is being installed silently in the background." -BackgroundColor Green 300 | Write-Host "Please allow a few minutes for it to install and use it to reinstall the necessary apps manually." 301 | } 302 | Catch { 303 | Show-Header 304 | Write-Host "An error occurred while trying to install the Microsoft Store. Please try again later." -BackgroundColor Red 305 | } 306 | Wait-IfNotSpecialize 307 | } 308 | 309 | # Function to check if WinGet is installed, install if necessary, and check for updates 310 | function Test-WinGetStatus { 311 | # Helper function to check if WinGet is installed 312 | function Test-WinGetInstalled { 313 | Try { 314 | winget --version | Out-Null 315 | return $true 316 | } 317 | Catch { 318 | return $false 319 | } 320 | } 321 | 322 | # Helper function to install required dependencies from GitHub 323 | function Install-WinGetDependencies { 324 | Show-Header 325 | Write-Host "Installing required dependencies, please wait . . ." -ForegroundColor Yellow 326 | 327 | # Define the URLs and paths for dependencies 328 | $dependencyUrls = @( 329 | @{Url = "https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.6/Microsoft.UI.Xaml.2.8.x64.appx"; Path = "$env:TEMP\Microsoft.UI.Xaml.2.8.appx" }, 330 | @{Url = "https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx"; Path = "$env:TEMP\Microsoft.VCLibs.140.00.UWPDesktop.x64.appx" } 331 | ) 332 | 333 | # Download and install each dependency 334 | foreach ($dependency in $dependencyUrls) { 335 | Try { 336 | Start-BitsTransfer -Source $dependency.Url -Destination $dependency.Path -TransferType Download -ErrorAction Stop | Out-Null 337 | Show-Header 338 | Try { 339 | Add-AppxPackage -Path $dependency.Path 340 | Show-Header 341 | } 342 | Catch { 343 | Write-Host "Failed to install $($dependency.Path). Please install it manually from the URL: $($dependency.Url)" -ForegroundColor Red 344 | Wait-IfNotSpecialize 345 | Exit 346 | } 347 | } 348 | Catch { 349 | Write-Host "Failed to download $($dependency.Path). Check your internet connection and try again." -ForegroundColor Red 350 | Wait-IfNotSpecialize 351 | Exit 352 | } 353 | } 354 | } 355 | 356 | # Function to install WinGet from GitHub if not found 357 | function Install-WinGet { 358 | Show-Header 359 | Write-Host "WinGet is not installed. Downloading the latest version from GitHub..." -ForegroundColor Yellow 360 | 361 | # Ensure internet connection is active 362 | if (-not (Test-InternetConnection)) { 363 | Show-Header 364 | Write-Host "No internet connection detected. Please connect to the internet and try again." -ForegroundColor Red 365 | Wait-IfNotSpecialize 366 | Exit 367 | } 368 | 369 | # Install the required dependencies 370 | Show-Header 371 | Install-WinGetDependencies 372 | 373 | # Define GitHub URL for WinGet releases 374 | $wingetDownloadUrl = "https://github.com/microsoft/winget-cli/releases/latest/download/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" 375 | $wingetInstallerPath = "$env:TEMP\WinGetInstaller.msixbundle" 376 | 377 | Try { 378 | Show-Header 379 | Write-Host "Starting download of WinGet installer using BITS..." 380 | 381 | Start-BitsTransfer -Source $wingetDownloadUrl -Destination $wingetInstallerPath -TransferType Download -ErrorAction Stop | Out-Null 382 | 383 | # Confirm the file was downloaded successfully 384 | if (-not (Test-Path $wingetInstallerPath) -or (Get-Item $wingetInstallerPath).Length -eq 0) { 385 | Show-Header 386 | Write-Host "The download failed or the file is empty. Please try downloading manually from: $wingetDownloadUrl" -ForegroundColor Red 387 | Wait-IfNotSpecialize 388 | Exit 389 | } 390 | 391 | Show-Header 392 | Write-Host "WinGet installer downloaded successfully." 393 | 394 | # Install the downloaded WinGet installer 395 | Try { 396 | Add-AppxPackage -Path $wingetInstallerPath 397 | Show-Header 398 | Write-Host "WinGet installed successfully." -ForegroundColor Green 399 | } 400 | Catch { 401 | Show-Header 402 | Write-Host "Failed to install WinGet. Please install it manually from the GitHub page: https://github.com/microsoft/winget-cli/releases" -ForegroundColor Red 403 | Wait-IfNotSpecialize 404 | Exit 405 | } 406 | } 407 | Catch { 408 | Show-Header 409 | Write-Host "Failed to download the WinGet installer. Check your internet connection and try again." -ForegroundColor Red 410 | Wait-IfNotSpecialize 411 | Exit 412 | } 413 | } 414 | 415 | # Check if WinGet is installed, if not, install it 416 | if (-not (Test-WinGetInstalled)) { 417 | Install-WinGet 418 | } 419 | 420 | # Once installed, check for updates 421 | Show-Header 422 | Write-Host "Checking for WinGet updates..." 423 | Try { 424 | $updateCheck = winget upgrade --id Microsoft.WinGet -e --accept-package-agreements --accept-source-agreements 2>&1 425 | if ($updateCheck -match "No installed package found" -or $updateCheck -match "No applicable upgrade found") { 426 | Show-Header 427 | Write-Host "WinGet is already up-to-date." -ForegroundColor Green 428 | } 429 | elseif ($updateCheck -match "An applicable upgrade is available") { 430 | # Perform the upgrade if available 431 | Show-Header 432 | Write-Host "An update is available for WinGet. Upgrading now..." 433 | Try { 434 | winget upgrade --id Microsoft.WinGet -e --accept-package-agreements --accept-source-agreements | Out-Null 435 | if ($LASTEXITCODE -eq 0) { 436 | Show-Header 437 | Write-Host "WinGet updated successfully." -ForegroundColor Green 438 | } 439 | else { 440 | Show-Header 441 | Write-Host "Failed to update WinGet. Proceeding with app installation..." -ForegroundColor Yellow 442 | } 443 | } 444 | Catch { 445 | Show-Header 446 | Write-Host "An error occurred while upgrading WinGet. Proceeding with app installation..." -ForegroundColor Yellow 447 | } 448 | } 449 | else { 450 | Show-Header 451 | Write-Host "Could not determine WinGet update status. Proceeding with app installation..." -ForegroundColor Yellow 452 | } 453 | } 454 | Catch { 455 | Show-Header 456 | Write-Host "An error occurred while checking for WinGet updates. Proceeding with app installation..." -ForegroundColor Yellow 457 | } 458 | } 459 | 460 | # Function to install an app using WinGet 461 | function Install-AppWithWinGet { 462 | param ( 463 | [string]$AppName, 464 | [string]$FriendlyName 465 | ) 466 | 467 | Show-Header 468 | 469 | # Check for internet connection 470 | if (-not (Test-InternetConnection)) { 471 | Show-Header 472 | Write-Host "No internet connection detected. Please connect to the internet and try again." -BackgroundColor Red 473 | Wait-IfNotSpecialize 474 | return 475 | } 476 | 477 | # Update WinGet to ensure it's the latest version 478 | Show-Header 479 | Test-WinGetStatus 480 | 481 | # Continue with app installation 482 | Show-Header 483 | Write-Host "Installing $FriendlyName using WinGet . . ." 484 | Try { 485 | # Attempt to install or upgrade the app using WinGet 486 | $installOutput = winget install --id $AppName -e --silent --accept-package-agreements --accept-source-agreements 2>&1 487 | 488 | if ($installOutput -match "Found an existing package already installed" -and $installOutput -match "No available upgrade found") { 489 | Write-Host "$FriendlyName is already installed and up-to-date." -BackgroundColor Green 490 | } 491 | elseif ($installOutput -match "Successfully installed") { 492 | Show-Header 493 | Write-Host "$FriendlyName installation completed successfully." -BackgroundColor Green 494 | } 495 | elseif ($installOutput -match "No package found") { 496 | Show-Header 497 | Write-Host "Failed to install $FriendlyName using ID '$AppName'. Package not found or check your internet connection." -BackgroundColor Red 498 | } 499 | else { 500 | Show-Header 501 | Write-Host "An issue occurred during the installation of $FriendlyName. Please check the app ID or try again later." -BackgroundColor Red 502 | } 503 | } 504 | Catch { 505 | Show-Header 506 | Write-Host "An unexpected error occurred while installing $FriendlyName." -BackgroundColor Red 507 | } 508 | Wait-IfNotSpecialize 509 | } 510 | 511 | # Remove Bloatware Apps Functions 512 | # Define Packages 513 | $appxPackages = @( 514 | 'Microsoft.Microsoft3DViewer', 'Microsoft.BingSearch', 'Microsoft.WindowsCamera', 'Clipchamp.Clipchamp', 515 | 'Microsoft.WindowsAlarms', 'Microsoft.549981C3F5F10', 'Microsoft.Windows.DevHome', 516 | 'MicrosoftCorporationII.MicrosoftFamily', 'Microsoft.WindowsFeedbackHub', 'Microsoft.GetHelp', 517 | 'microsoft.windowscommunicationsapps', 'Microsoft.WindowsMaps', 'Microsoft.ZuneVideo', 518 | 'Microsoft.BingNews', 'Microsoft.MicrosoftOfficeHub', 'Microsoft.Office.OneNote', 519 | 'Microsoft.OutlookForWindows', 'Microsoft.People', 'Microsoft.Windows.Photos', 520 | 'Microsoft.PowerAutomateDesktop', 'MicrosoftCorporationII.QuickAssist', 'Microsoft.SkypeApp', 521 | 'Microsoft.MicrosoftSolitaireCollection', 'Microsoft.MicrosoftStickyNotes', 'MSTeams', 522 | 'Microsoft.Getstarted', 'Microsoft.Todos', 'Microsoft.WindowsSoundRecorder', 'Microsoft.BingWeather', 523 | 'Microsoft.ZuneMusic', 'Microsoft.WindowsTerminal', 'Microsoft.Xbox.TCUI', 'Microsoft.XboxApp', 524 | 'Microsoft.XboxGameOverlay', 'Microsoft.XboxGamingOverlay', 'Microsoft.XboxIdentityProvider', 525 | 'Microsoft.XboxSpeechToTextOverlay', 'Microsoft.GamingApp', 'Microsoft.YourPhone', 'Microsoft.OneDrive', 526 | 'Microsoft.549981C3F5F10', 'Microsoft.MixedReality.Portal', 'Microsoft.ScreenSketch' 527 | 'Microsoft.Windows.Ai.Copilot.Provider', 'Microsoft.Copilot', 'Microsoft.Copilot_8wekyb3d8bbwe', 528 | 'Microsoft.WindowsMeetNow', 'Microsoft.WindowsStore', 'Microsoft.Paint', 'Microsoft.MSPaint' 529 | ) 530 | 531 | # Define Windows Capabilities 532 | $capabilities = @( 533 | 'Browser.InternetExplorer', 'MathRecognizer', 'OpenSSH.Client', 534 | 'Microsoft.Windows.PowerShell.ISE', 'App.Support.QuickAssist', 'App.StepsRecorder', 535 | 'Media.WindowsMediaPlayer', 'Microsoft.Windows.WordPad', 'Microsoft.Windows.MSPaint' 536 | ) 537 | 538 | # Apply registry mods to prevent reinstallation and disable features 539 | function Set-AppsRegistry { 540 | $MultilineComment = @" 541 | Windows Registry Editor Version 5.00 542 | 543 | ; --Application and Feature Restrictions-- 544 | 545 | ; Disable Windows Copilot system-wide 546 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot] 547 | "TurnOffWindowsCopilot"=dword:00000001 548 | 549 | ; Prevents Dev Home Installation 550 | [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\DevHomeUpdate] 551 | 552 | ; Prevents New Outlook for Windows Installation 553 | [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\OutlookUpdate] 554 | 555 | ; Prevents Chat Auto Installation 556 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Communications] 557 | "ConfigureChatAutoInstall"=dword:00000000 558 | 559 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Chat] 560 | "ChatIcon"=dword:00000003 561 | 562 | ; Disables Cortana 563 | [HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Windows Search] 564 | "AllowCortana"=dword:00000000 565 | 566 | ; Disables OneDrive Automatic Backups of Important Folders (Documents, Pictures etc.) 567 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\OneDrive] 568 | "KFMBlockOptIn"=dword:00000001 569 | "@ 570 | Set-Content -Path "$env:TEMP\Windows_Apps.reg" -Value $MultilineComment -Force -ErrorAction SilentlyContinue 571 | Regedit.exe /S "$env:TEMP\Windows_Apps.reg" -Force -ErrorAction SilentlyContinue 572 | } 573 | 574 | # Removes OneDrive during Windows Installation 575 | function Remove-OneDrive { 576 | Remove-Item "C:\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk" -ErrorAction SilentlyContinue 577 | Remove-Item "C:\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.exe" -ErrorAction SilentlyContinue 578 | Remove-Item "C:\Windows\System32\OneDriveSetup.exe" -ErrorAction SilentlyContinue 579 | Remove-Item "C:\Windows\SysWOW64\OneDriveSetup.exe" -ErrorAction SilentlyContinue 580 | } 581 | 582 | # Uninstalls OneDrive in existing Windows Installation 583 | function Uninstall-OneDrive { 584 | # stop onedrive running 585 | Stop-Process -Force -Name OneDrive -ErrorAction SilentlyContinue | Out-Null 586 | # uninstall onedrive w10 587 | cmd /c "C:\Windows\SysWOW64\OneDriveSetup.exe -uninstall >nul 2>&1" 588 | # clean onedrive w10 589 | Get-ScheduledTask | Where-Object { $_.Taskname -match 'OneDrive' } | Unregister-ScheduledTask -Confirm:$false 590 | # uninstall onedrive w11 591 | cmd /c "C:\Windows\System32\OneDriveSetup.exe -uninstall >nul 2>&1" 592 | } 593 | 594 | # Disables Recall 595 | function Disable-Recall { 596 | Dism /Online /Disable-Feature /Featurename:Recall /NoRestart | Out-Null 597 | } 598 | 599 | # Remove All Bloatware (UWP) Apps from Windows. 600 | function Remove-Apps { 601 | Show-Header 602 | Write-Host "Are You Sure You Want to Remove ALL Windows Apps? (Y/N)" -ForegroundColor Black -Backgroundcolor Yellow 603 | Write-Host "Includes: OneDrive, Teams, Outlook for Windows and more . . ." -ForegroundColor Black -Backgroundcolor Yellow 604 | Write-Host "(CAUTION! Can't be Undone!)" -BackgroundColor Red 605 | $confirmation = Read-Host "Enter your choice" 606 | 607 | if ($confirmation -eq 'Y' -or $confirmation -eq 'y') { 608 | Show-Header 609 | Write-Host "Removing Pre-installed Apps and Features. Please wait . . ." 610 | # Bloatware Apps 611 | Get-AppxPackage -AllUsers | 612 | Where-Object { $appxPackages -contains $_.Name } | 613 | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue | Out-Null 614 | # Legacy Windows Features & Apps 615 | Get-WindowsCapability -Online | 616 | Where-Object { $capabilities -contains ($_.Name -split '~')[0] } | 617 | Remove-WindowsCapability -Online -ErrorAction SilentlyContinue | Out-Null 618 | # Calls specified functions 619 | Show-Header 620 | Set-AppsRegistry 621 | Uninstall-OneDrive 622 | Show-Header 623 | Disable-Recall 624 | Show-Header 625 | Write-Host "Pre-installed Apps and Features removed successfully." -BackgroundColor Green 626 | Wait-IfNotSpecialize 627 | } 628 | else { 629 | Show-MainMenu 630 | } 631 | } 632 | # End of Software & Apps Functions 633 | 634 | # Start of Privacy & Security Functions 635 | # Check if Windows Defender is Enabled or Disabled 636 | function Get-WindowsDefenderStatus { 637 | Clear-Host 638 | $defenderKey = "HKLM:\SYSTEM\CurrentControlSet\Services\Sense" 639 | $defenderStatus = (Get-ItemProperty -Path $defenderKey -Name Start).Start 640 | 641 | if ($defenderStatus -eq 4) { 642 | Show-Header 643 | Write-Host "Windows Defender is permanently disabled." -ForegroundColor Red 644 | Write-Host "Press 1 to enable Windows Defender." 645 | Write-Host "Note: Enabling Defender using this script means it cannot be permanently disabled again without reinstalling Windows with the UnattendedWinstall XML file." 646 | 647 | $choice = Read-Host "Enter your choice (1 to enable, any other key to cancel)" 648 | 649 | if ($choice -eq '1') { 650 | $confirm = Read-Host "Are you sure you want to enable Windows Defender? (y/n)" 651 | if ($confirm -eq 'y') { 652 | Enable-WindowsDefender 653 | } 654 | else { 655 | Show-MainMenu 656 | } 657 | } 658 | else { 659 | Show-MainMenu 660 | } 661 | } 662 | else { 663 | Show-Header 664 | Write-Host "Windows Defender is already enabled. No action is needed." -ForegroundColor Green 665 | Write-Host "Press any key to go back to the main menu." 666 | Read-Host 667 | Show-MainMenu 668 | } 669 | } 670 | 671 | 672 | # Function to Enable Windows Defender 673 | function Enable-WindowsDefender { 674 | $MultilineComment = @" 675 | Windows Registry Editor Version 5.00 676 | 677 | ; Enables Windows Defender to start in Windows Security 678 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Sense] 679 | "Start"=dword:00000003 680 | 681 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WdBoot] 682 | "Start"=dword:00000000 683 | 684 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WdFilter] 685 | "Start"=dword:00000000 686 | 687 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WdNisDrv] 688 | "Start"=dword:00000003 689 | 690 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WdNisSvc] 691 | "Start"=dword:00000003 692 | 693 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinDefend] 694 | "Start"=dword:00000002 695 | "@ 696 | Set-Content -Path "$env:TEMP\Enable_Windows_Defender.reg" -Value $MultilineComment -Force 697 | $path = "$env:TEMP\Enable_Windows_Defender.reg" 698 | (Get-Content $path) -replace "\?", "$" | Out-File $path 699 | Regedit.exe /S "$env:TEMP\Enable_Windows_Defender.reg" 700 | Write-Host "Windows Defender has been enabled." -ForegroundColor Green 701 | Write-Host "Press any key to return to the main menu." 702 | Read-Host 703 | } 704 | 705 | # Check if User Account Control is Enabled or Disabled 706 | function Get-UACStatus { 707 | Clear-Host 708 | $uacKey = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" 709 | 710 | # Get the EnableLUA and ConsentPromptBehaviorAdmin values 711 | $uacStatus = (Get-ItemProperty -Path $uacKey -Name EnableLUA).EnableLUA 712 | $promptBehavior = (Get-ItemProperty -Path $uacKey -Name ConsentPromptBehaviorAdmin).ConsentPromptBehaviorAdmin 713 | 714 | # Determine if UAC is disabled based on both keys 715 | if ($uacStatus -eq 0 -or $promptBehavior -eq 0) { 716 | Show-Header 717 | Write-Host "User Account Control (UAC) is currently disabled." -ForegroundColor Red 718 | Write-Host "1. Enable UAC" 719 | } 720 | else { 721 | Show-Header 722 | Write-Host "User Account Control (UAC) is currently enabled." -ForegroundColor Green 723 | Write-Host "1. Disable UAC" 724 | } 725 | Write-Host "0. Main Menu" 726 | $choice = Read-Host "Select an option" 727 | switch ($choice) { 728 | 1 { 729 | $confirm = Read-Host "Are you sure you want to change UAC status? (y/n)" 730 | if ($confirm -eq 'y') { 731 | if ($uacStatus -eq 0) { 732 | # Enable UAC and set the default prompt behavior 733 | cmd.exe /c reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 1 /f 2>&1 | Out-Null 734 | cmd.exe /c reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v ConsentPromptBehaviorAdmin /t REG_DWORD /d 2 /f 2>&1 | Out-Null 735 | Write-Host "UAC has been enabled successfully." -ForegroundColor Green 736 | } 737 | else { 738 | # Disable UAC and default prompt behavior 739 | cmd.exe /c reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 0 /f 2>&1 | Out-Null 740 | cmd.exe /c reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v ConsentPromptBehaviorAdmin /t REG_DWORD /d 0 /f 2>&1 | Out-Null 741 | Write-Host "UAC has been disabled successfully." -ForegroundColor Green 742 | } 743 | Write-Host "Press any key to continue." 744 | Read-Host 745 | Get-UACStatus 746 | } 747 | else { 748 | Get-UACStatus 749 | } 750 | } 751 | 0 { Return } 752 | default { Write-Host "Invalid choice. Try again."; Get-UACStatus } 753 | } 754 | } 755 | 756 | 757 | # Function to Apply the Recommended Privacy Settings 758 | function Set-RecommendedPrivacySettings { 759 | 760 | if (-not $isSpecializePhase) { 761 | Show-Header 762 | Write-Host "Applying Recommended Privacy Settings . . ." 763 | } 764 | 765 | $MultilineComment = @" 766 | Windows Registry Editor Version 5.00 767 | 768 | ; --Privacy and Security Settings-- 769 | 770 | ; Disables Activity History 771 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System] 772 | "EnableActivityFeed"=dword:00000000 773 | "PublishUserActivities"=dword:00000000 774 | "UploadUserActivities"=dword:00000000 775 | 776 | ; Disables Location Tracking 777 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location] 778 | "Value"="Deny" 779 | 780 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}] 781 | "SensorPermissionState"=dword:00000000 782 | 783 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration] 784 | "Status"=dword:00000000 785 | 786 | [HKEY_LOCAL_MACHINE\SYSTEM\Maps] 787 | "AutoUpdateEnabled"=dword:00000000 788 | 789 | ; Disables Telemetry 790 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection] 791 | "AllowTelemetry"=dword:00000000 792 | 793 | ; Disables Telemetry and Feedback Notifications 794 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection] 795 | "AllowTelemetry"=dword:00000000 796 | "DoNotShowFeedbackNotifications"=dword:00000001 797 | 798 | ; Disables Windows Ink Workspace 799 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace] 800 | "AllowWindowsInkWorkspace"=dword:00000000 801 | 802 | ; Disables the Advertising ID for All Users 803 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo] 804 | "DisabledByGroupPolicy"=dword:00000001 805 | 806 | ; Disable Account Info 807 | [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userAccountInformation] 808 | "Value"="Deny" 809 | "@ 810 | # Write the registry changes to a file and silently import it using regedit 811 | Set-Content -Path "$env:TEMP\Recommended_Privacy_Settings.reg" -Value $MultilineComment -Force 812 | Start-Process -FilePath "regedit.exe" -ArgumentList "/S `"$env:TEMP\Recommended_Privacy_Settings.reg`"" -NoNewWindow -Wait 813 | 814 | if (-not $isSpecializePhase) { 815 | Show-Header 816 | Write-Host "Recommended Privacy Settings Applied." -ForegroundColor Green 817 | Wait-IfNotSpecialize 818 | } 819 | } 820 | 821 | 822 | # Function to Apply the Default Privacy Settings 823 | function Set-DefaultPrivacySettings { 824 | 825 | Show-Header 826 | Write-Host "Applying Default Privacy Settings . . ." 827 | 828 | $MultilineComment = @" 829 | Windows Registry Editor Version 5.00 830 | 831 | ; --Revert Privacy and Security Settings-- 832 | 833 | ; Enables Activity History 834 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System] 835 | "EnableActivityFeed"=- 836 | "PublishUserActivities"=- 837 | "UploadUserActivities"=- 838 | 839 | ; Enables Location Tracking 840 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location] 841 | "Value"=- 842 | 843 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}] 844 | "SensorPermissionState"=- 845 | 846 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration] 847 | "Status"=- 848 | 849 | [HKEY_LOCAL_MACHINE\SYSTEM\Maps] 850 | "AutoUpdateEnabled"=dword:00000001 851 | 852 | ; Enables Telemetry to the default level 853 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection] 854 | "AllowTelemetry"=- 855 | 856 | ; Enables Telemetry and Feedback Notifications 857 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection] 858 | "AllowTelemetry"=- 859 | "DoNotShowFeedbackNotifications"=- 860 | 861 | ; Enables Windows Ink Workspace 862 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace] 863 | "AllowWindowsInkWorkspace"=- 864 | 865 | ; Enables the Advertising ID for All Users 866 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo] 867 | "DisabledByGroupPolicy"=- 868 | 869 | ; Allow Account info 870 | [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userAccountInformation] 871 | "Value"="Allow" 872 | "@ 873 | Set-Content -Path "$env:TEMP\Default_Privacy_Settings.reg" -Value $MultilineComment -Force 874 | Regedit.exe /S "$env:TEMP\Default_Privacy_Settings.reg" 875 | Show-Header 876 | Write-Host "Default Privacy Settings Applied." -ForegroundColor Green 877 | Wait-IfNotSpecialize 878 | } 879 | 880 | # End of Privacy and Security Functions 881 | 882 | # Start of Windows Update Functions 883 | function Set-RecommendedUpdateSettings { 884 | 885 | if (-not $isSpecializePhase) { 886 | Show-Header 887 | Write-Host "Applying Recommended Windows Update Settings . . ." 888 | } 889 | 890 | $MultilineComment = @" 891 | Windows Registry Editor Version 5.00 892 | 893 | ; --Windows Update Settings-- 894 | 895 | ; Disable Automatic Updates (Only Check for Updates Manually) 896 | ; Notify Before Downloading and Installing Updates 897 | ; Enable Notifications for Security Updates Only (Do Not Auto-Download) 898 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU] 899 | "NoAutoUpdate"=dword:00000001 900 | "AUOptions"=dword:00000002 901 | "AutoInstallMinorUpdates"=dword:00000000 902 | 903 | ; Prevent Automatic Upgrade from Windows 10 22H2 to Windows 11 (Manual Upgrade Still Allowed) 904 | ; Delay Feature and Quality updates for 1 year from install. 905 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate] 906 | "TargetReleaseVersion"=dword:00000001 907 | "TargetReleaseVersionInfo"="22H2" 908 | "ProductVersion"="Windows 10" 909 | "DeferFeatureUpdates"=dword:00000001 910 | "DeferFeatureUpdatesPeriodInDays"=dword:0000016d 911 | "DeferQualityUpdates"=dword:00000001 912 | "DeferQualityUpdatesPeriodInDays"=dword:00000007 913 | 914 | ; Disables allowing downloads from other PCs (Delivery Optimization) 915 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization] 916 | "DODownloadMode"=dword:00000000 917 | "@ 918 | Set-Content -Path "$env:TEMP\Recommended_Windows_Update_Settings.reg" -Value $MultilineComment -Force 919 | # import reg file 920 | Regedit.exe /S "$env:TEMP\Recommended_Windows_Update_Settings.reg" 921 | 922 | if (-not $isSpecializePhase) { 923 | Show-Header 924 | Write-Host "Recommended Windows Update Settings Applied." -ForegroundColor Green 925 | Wait-IfNotSpecialize 926 | } 927 | } 928 | 929 | function Set-DefaultUpdateSettings { 930 | 931 | Show-Header 932 | Write-Host "Applying Default Windows Update Settings . . ." 933 | 934 | $MultilineComment = @" 935 | Windows Registry Editor Version 5.00 936 | 937 | ; --Set Default Windows Update Settings-- 938 | 939 | ; Enable Automatic Updates (Default: Automatic Download and Install) 940 | ; Set Updates to Default Behavior (Automatic Download and Install) 941 | ; Allow Automatic Installation of Minor Updates (Default: Allowed) 942 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU] 943 | "NoAutoUpdate"=- 944 | "AUOptions"=- 945 | "AutoInstallMinorUpdates"=- 946 | 947 | ; --Revert Windows 10 22H2 Auto Upgrade to 11 Block to Default-- 948 | ; Allow Feature and Quality updates 949 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate] 950 | "TargetReleaseVersion"=- 951 | "TargetReleaseVersionInfo"=- 952 | "ProductVersion"=- 953 | "DeferFeatureUpdates"=- 954 | "DeferFeatureUpdatesPeriodInDays"=- 955 | "DeferQualityUpdates"=dword:- 956 | "DeferQualityUpdatesPeriodInDays"=- 957 | 958 | ; Reverts Delivery Optimization settings to allow downloads from other PCs 959 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization] 960 | "DODownloadMode"=- 961 | "@ 962 | Set-Content -Path "$env:TEMP\Default_Windows_Update_Settings.reg" -Value $MultilineComment -Force 963 | Regedit.exe /S "$env:TEMP\Default_Windows_Update_Settings.reg" 964 | 965 | Show-Header 966 | Write-Host "Default Windows Update Settings Applied." -ForegroundColor Green 967 | Wait-IfNotSpecialize 968 | } 969 | # End of Windows Update Functions 970 | 971 | # Start of Registry Optimizations 972 | function Set-RecommendedHKLMRegistry { 973 | # Create Registry Keys 974 | $MultilineComment = @" 975 | Windows Registry Editor Version 5.00 976 | 977 | ; Adds "Take Ownership" to the Right Click Context Menu for All Users 978 | 979 | [-HKEY_CLASSES_ROOT\*\shell\TakeOwnership] 980 | [-HKEY_CLASSES_ROOT\*\shell\runas] 981 | 982 | [HKEY_CLASSES_ROOT\*\shell\TakeOwnership] 983 | @="Take Ownership" 984 | "Extended"=- 985 | "HasLUAShield"="" 986 | "NoWorkingDirectory"="" 987 | "NeverDefault"="" 988 | 989 | [HKEY_CLASSES_ROOT\*\shell\TakeOwnership\command] 990 | @="powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c takeown /f \\\"%1\\\" && icacls \\\"%1\\\" /grant *S-1-3-4:F /t /c /l & pause' -Verb runAs\"" 991 | "IsolatedCommand"= "powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c takeown /f \\\"%1\\\" && icacls \\\"%1\\\" /grant *S-1-3-4:F /t /c /l & pause' -Verb runAs\"" 992 | 993 | [HKEY_CLASSES_ROOT\Directory\shell\TakeOwnership] 994 | @="Take Ownership" 995 | "AppliesTo"="NOT (System.ItemPathDisplay:=\"C:\\Users\" OR System.ItemPathDisplay:=\"C:\\ProgramData\" OR System.ItemPathDisplay:=\"C:\\Windows\" OR System.ItemPathDisplay:=\"C:\\Windows\\System32\" OR System.ItemPathDisplay:=\"C:\\Program Files\" OR System.ItemPathDisplay:=\"C:\\Program Files (x86)\")" 996 | "Extended"=- 997 | "HasLUAShield"="" 998 | "NoWorkingDirectory"="" 999 | "Position"="middle" 1000 | 1001 | [HKEY_CLASSES_ROOT\Directory\shell\TakeOwnership\command] 1002 | @="powershell -windowstyle hidden -command \"$Y = ($null | choice).Substring(1,1); Start-Process cmd -ArgumentList ('/c takeown /f \\\"%1\\\" /r /d ' + $Y + ' && icacls \\\"%1\\\" /grant *S-1-3-4:F /t /c /l /q & pause') -Verb runAs\"" 1003 | "IsolatedCommand"="powershell -windowstyle hidden -command \"$Y = ($null | choice).Substring(1,1); Start-Process cmd -ArgumentList ('/c takeown /f \\\"%1\\\" /r /d ' + $Y + ' && icacls \\\"%1\\\" /grant *S-1-3-4:F /t /c /l /q & pause') -Verb runAs\"" 1004 | 1005 | [HKEY_CLASSES_ROOT\Drive\shell\runas] 1006 | @="Take Ownership" 1007 | "Extended"=- 1008 | "HasLUAShield"="" 1009 | "NoWorkingDirectory"="" 1010 | "Position"="middle" 1011 | "AppliesTo"="NOT (System.ItemPathDisplay:=\"C:\\\")" 1012 | 1013 | [HKEY_CLASSES_ROOT\Drive\shell\runas\command] 1014 | @="cmd.exe /c takeown /f \"%1\\\" /r /d y && icacls \"%1\\\" /grant *S-1-3-4:F /t /c & Pause" 1015 | "IsolatedCommand"="cmd.exe /c takeown /f \"%1\\\" /r /d y && icacls \"%1\\\" /grant *S-1-3-4:F /t /c & Pause" 1016 | 1017 | ; --Application and Feature Restrictions-- 1018 | 1019 | ; Disable Windows Copilot system-wide 1020 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot] 1021 | "TurnOffWindowsCopilot"=dword:00000001 1022 | 1023 | ; Prevents Dev Home Installation 1024 | [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\DevHomeUpdate] 1025 | 1026 | ; Prevents New Outlook for Windows Installation 1027 | [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\OutlookUpdate] 1028 | 1029 | ; Prevents Chat Auto Installation and Removes Chat Icon 1030 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Communications] 1031 | "ConfigureChatAutoInstall"=dword:00000000 1032 | 1033 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Chat] 1034 | "ChatIcon"=dword:00000003 1035 | 1036 | ; Disables Bitlocker Auto Encryption on Windows 11 24H2 and Onwards 1037 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\BitLocker] 1038 | "PreventDeviceEncryption"=dword:00000001 1039 | 1040 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EnhancedStorageDevices] 1041 | "TCGSecurityActivationDisabled"=dword:00000001 1042 | 1043 | ; Disables Cortana 1044 | [HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Windows Search] 1045 | "AllowCortana"=dword:00000000 1046 | 1047 | ; Set Registry Keys to Disable Wifi-Sense 1048 | [HKEY_LOCAL_MACHINE\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting] 1049 | "Value"=dword:00000000 1050 | 1051 | [HKEY_LOCAL_MACHINE\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots] 1052 | "Value"=dword:00000000 1053 | 1054 | ; Disable Tablet Mode 1055 | ; Always go to desktop mode on sign-in 1056 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ImmersiveShell] 1057 | "TabletMode"=dword:00000000 1058 | "SignInMode"=dword:00000001 1059 | 1060 | ; Disable Xbox GameDVR 1061 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GameDVR] 1062 | "AllowGameDVR"=dword:00000000 1063 | 1064 | ; Disables OneDrive Automatic Backups of Important Folders (Documents, Pictures etc.) 1065 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\OneDrive] 1066 | "KFMBlockOptIn"=dword:00000001 1067 | 1068 | ; Disables the "Push To Install" feature in Windows 1069 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PushToInstall] 1070 | "DisablePushToInstall"=dword:00000001 1071 | 1072 | ; Disables Windows Consumer Features Like App Promotions etc. 1073 | ; Disables Consumer Account State Content 1074 | ; Disables Cloud Optimized Content 1075 | [HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\CloudContent] 1076 | "DisableWindowsConsumerFeatures"=dword:00000000 1077 | "DisableConsumerAccountStateContent"=dword:00000001 1078 | "DisableCloudOptimizedContent"=dword:00000001 1079 | 1080 | ; Blocks the "Allow my organization to manage my device" and "No, sign in to this app only" pop-up message 1081 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WorkplaceJoin] 1082 | "BlockAADWorkplaceJoin"=dword:00000001 1083 | 1084 | ; --Start Menu Customization-- 1085 | ; Removes All Pinned Apps from the Start Menu to Clean it Up 1086 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\current\device\Start] 1087 | "ConfigureStartPins"="{ \"pinnedList\": [] }" 1088 | "ConfigureStartPins_ProviderSet"=dword:00000001 1089 | "ConfigureStartPins_WinningProvider"="B5292708-1619-419B-9923-E5D9F3925E71" 1090 | 1091 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\providers\B5292708-1619-419B-9923-E5D9F3925E71\default\Device\Start] 1092 | "ConfigureStartPins"="{ \"pinnedList\": [] }" 1093 | "ConfigureStartPins_LastWrite"=dword:00000001 1094 | 1095 | ; --File System Settings-- 1096 | ; Enable Long File Paths with Up to 32,767 Characters 1097 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem] 1098 | "LongPathsEnabled"=dword:00000001 1099 | 1100 | ; --Multimedia and Gaming Performance-- 1101 | ; Gives Multimedia Applications like Games and Video Editing a Higher Priority 1102 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile] 1103 | "SystemResponsiveness"=dword:00000000 1104 | "NetworkThrottlingIndex"=dword:0000000a 1105 | 1106 | ; Gives Graphics Cards a Higher Priority for Gaming 1107 | ; Gives the CPU a Higher Priority for Gaming 1108 | ; Gives Games a higher priority in the system's scheduling 1109 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games] 1110 | "GPU Priority"=dword:00000008 1111 | "Priority"=dword:00000006 1112 | "Scheduling Category"="High" 1113 | 1114 | ; disable startup sound 1115 | [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\BootAnimation] 1116 | "DisableStartupSound"=dword:00000001 1117 | 1118 | [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\EditionOverrides] 1119 | "UserSetting_DisableStartupSound"=dword:00000001 1120 | 1121 | ; disable device installation settings 1122 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata] 1123 | "PreventDeviceMetadataFromNetwork"=dword:00000001 1124 | 1125 | ; NETWORK AND INTERNET 1126 | ; disable allow other network users to control or disable the shared internet connection 1127 | [HKEY_LOCAL_MACHINE\System\ControlSet001\Control\Network\SharedAccessConnection] 1128 | "EnableControl"=dword:00000000 1129 | 1130 | ; SYSTEM AND SECURITY 1131 | ; adjust for best performance of programs 1132 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\PriorityControl] 1133 | "Win32PrioritySeparation"=dword:00000026 1134 | 1135 | ; disable remote assistance 1136 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Remote Assistance] 1137 | "fAllowToGetHelp"=dword:00000000 1138 | 1139 | ; TROUBLESHOOTING 1140 | ; disable automatic maintenance 1141 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\Maintenance] 1142 | "MaintenanceDisabled"=dword:00000001 1143 | 1144 | ; SECURITY AND MAINTENANCE 1145 | ; disable report problems 1146 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting] 1147 | "Disabled"=dword:00000001 1148 | 1149 | ; ACCOUNTS 1150 | ; disable use my sign in info after restart 1151 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System] 1152 | "DisableAutomaticRestartSignOn"=dword:00000001 1153 | 1154 | ; APPS 1155 | ; disable archive apps 1156 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Appx] 1157 | "AllowAutomaticAppArchiving"=dword:00000000 1158 | 1159 | ; PERSONALIZATION 1160 | ; Hides the Meet Now Button on the Taskbar 1161 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer] 1162 | "HideSCAMeetNow"=dword:00000001 1163 | "NoStartMenuMFUprogramsList"=- 1164 | "NoInstrumentation"=- 1165 | 1166 | ; remove windows widgets from taskbar 1167 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Dsh] 1168 | "AllowNewsAndInterests"=dword:00000000 1169 | 1170 | ; remove news and interests from Taskbar 1171 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds] 1172 | "EnableFeeds"=dword:00000000 1173 | 1174 | ; SYSTEM 1175 | ; turn on hardware accelerated gpu scheduling 1176 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers] 1177 | "HwSchMode"=dword:00000002 1178 | 1179 | ; disable storage sense 1180 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\StorageSense] 1181 | "AllowStorageSenseGlobal"=dword:00000000 1182 | 1183 | ; --OTHER-- 1184 | ; Disable update Microsoft Store apps automatically 1185 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore] 1186 | "AutoDownload"=dword:00000002 1187 | 1188 | ; UWP APPS 1189 | ; disable background apps 1190 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy] 1191 | "LetAppsRunInBackground"=dword:00000002 1192 | 1193 | ; disable widgets 1194 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\default\NewsAndInterests\AllowNewsAndInterests] 1195 | "value"=dword:00000000 1196 | 1197 | ; NVIDIA 1198 | ; enable old nvidia sharpening 1199 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\nvlddmkm\FTS] 1200 | "EnableGR535"=dword:00000000 1201 | 1202 | ; OTHER 1203 | ; remove 3d objects 1204 | [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}] 1205 | [-HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}] 1206 | 1207 | ; Remove Home Folder 1208 | [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{f874310e-b6b7-47dc-bc84-b9e6b38f5903}] 1209 | 1210 | [HKEY_USERS\.DEFAULT\Control Panel\Mouse] 1211 | "MouseSpeed"="0" 1212 | "MouseThreshold1"="0" 1213 | "MouseThreshold2"="0" 1214 | "@ 1215 | Set-Content -Path "$env:TEMP\Optimize_LocalMachine_Registry.reg" -Value $MultilineComment -Force 1216 | # edit reg file 1217 | $path = "$env:TEMP\Optimize_LocalMachine_Registry.reg" 1218 | (Get-Content $path) -replace "\?", "$" | Out-File $path 1219 | # import reg file 1220 | Regedit.exe /S "$env:TEMP\Optimize_LocalMachine_Registry.reg" 1221 | Show-Header 1222 | Write-Host "Recommended Local Machine Registry Settings Applied." -ForegroundColor Green 1223 | Wait-IfNotSpecialize 1224 | } 1225 | 1226 | function Set-DefaultHKLMRegistry { 1227 | # create reg file 1228 | $MultilineComment = @" 1229 | Windows Registry Editor Version 5.00 1230 | 1231 | ; --Revert Application and Feature Restrictions-- 1232 | 1233 | ; Allows Dev Home Installation 1234 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\DevHomeUpdate] 1235 | @="" 1236 | 1237 | ; Allows New Outlook for Windows Installation 1238 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\OutlookUpdate] 1239 | @="" 1240 | 1241 | ; Reverts Chat Auto Installation and Restores Chat Icon 1242 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Communications] 1243 | "ConfigureChatAutoInstall"=dword:00000001 1244 | 1245 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Chat] 1246 | "ChatIcon"=dword:00000001 1247 | 1248 | ; Enables News and Interests 1249 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Dsh] 1250 | "AllowNewsAndInterests"=- 1251 | 1252 | ; Enables BitLocker Auto Encryption on Windows 11 24H2 and Onwards 1253 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\BitLocker] 1254 | "PreventDeviceEncryption"=- 1255 | 1256 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EnhancedStorageDevices] 1257 | "TCGSecurityActivationDisabled"=- 1258 | 1259 | ; Enables Cortana 1260 | [HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Windows Search] 1261 | "AllowCortana"=- 1262 | 1263 | ; Shows the Meet Now Button on the Taskbar 1264 | ; Shows Recently Added Apps in Start Menu 1265 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer] 1266 | "HideSCAMeetNow"=- 1267 | 1268 | ; Re-enables WiFi-Sense 1269 | [HKEY_LOCAL_MACHINE\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting] 1270 | "Value"=dword:00000001 1271 | 1272 | [HKEY_LOCAL_MACHINE\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots] 1273 | "Value"=dword:00000001 1274 | 1275 | ; Enables Tablet Mode 1276 | ; Default Sign-In Mode 1277 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ImmersiveShell] 1278 | "TabletMode"=dword:00000001 1279 | "SignInMode"=dword:00000000 1280 | 1281 | ; Enables Xbox GameDVR 1282 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GameDVR] 1283 | "AllowGameDVR"=- 1284 | 1285 | ; Enables OneDrive Automatic Backups of Important Folders (Documents, Pictures etc.) 1286 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\OneDrive] 1287 | "KFMBlockOptIn"=- 1288 | 1289 | ; Enables "Push To Install" feature in Windows 1290 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PushToInstall] 1291 | "DisablePushToInstall"=- 1292 | 1293 | ; Enables Windows Consumer Features Like App Promotions etc. 1294 | ; Enables Consumer Account State Content 1295 | ; Enables Cloud Optimized Content 1296 | [HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\CloudContent] 1297 | "DisableWindowsConsumerFeatures"=- 1298 | "DisableConsumerAccountStateContent"=- 1299 | "DisableCloudOptimizedContent"=- 1300 | 1301 | ; Unblocks "Allow my organization to manage my device" pop-up message 1302 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WorkplaceJoin] 1303 | "BlockAADWorkplaceJoin"=- 1304 | 1305 | ; --Revert Start Menu Customization-- 1306 | 1307 | ; Restores Default Pinned Apps to the Start Menu 1308 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\current\device\Start] 1309 | "ConfigureStartPins"=- 1310 | "ConfigureStartPins_ProviderSet"=- 1311 | "ConfigureStartPins_WinningProvider"=- 1312 | 1313 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\providers\B5292708-1619-419B-9923-E5D9F3925E71\default\Device\Start] 1314 | "ConfigureStartPins"=- 1315 | "ConfigureStartPins_LastWrite"=- 1316 | 1317 | ; --Revert File System Settings-- 1318 | 1319 | ; Revert Long File Paths to Default (Disabled) 1320 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem] 1321 | "LongPathsEnabled"=dword:00000000 1322 | 1323 | ; --Revert Multimedia and Gaming Performance-- 1324 | 1325 | ; Reverts Multimedia Applications' System Responsiveness and Network Throttling Index to Default Values 1326 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile] 1327 | "SystemResponsiveness"=dword:00000014 1328 | "NetworkThrottlingIndex"=dword:ffffffff 1329 | 1330 | ; --Revert Gaming Performance-- 1331 | 1332 | ; Reverts Graphics Cards Priority for Gaming to Default 1333 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games] 1334 | "GPU Priority"=dword:00000002 ; Default value is 2 1335 | 1336 | ; Reverts CPU Priority for Gaming to Default 1337 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games] 1338 | "Priority"=dword:00000002 ; Default value is 2 1339 | 1340 | ; Reverts Games Scheduling Category to Default 1341 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games] 1342 | "Scheduling Category"="Medium" ; Default value is "Medium" 1343 | 1344 | ; Removes "Take Ownership" from Context Menu 1345 | [-HKEY_CLASSES_ROOT\*\shell\TakeOwnership] 1346 | 1347 | [-HKEY_CLASSES_ROOT\*\shell\runas] 1348 | 1349 | [-HKEY_CLASSES_ROOT\Directory\shell\TakeOwnership] 1350 | 1351 | [-HKEY_CLASSES_ROOT\Drive\shell\runas] 1352 | 1353 | ; HARDWARE AND SOUND 1354 | ; lock 1355 | [-HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings] 1356 | 1357 | ; sleep 1358 | [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings] 1359 | 1360 | ; startup sound 1361 | [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\BootAnimation] 1362 | "DisableStartupSound"=dword:00000000 1363 | 1364 | [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\EditionOverrides] 1365 | "UserSetting_DisableStartupSound"=dword:00000000 1366 | 1367 | ; device installation settings 1368 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata] 1369 | "PreventDeviceMetadataFromNetwork"=dword:00000000 1370 | 1371 | ; NETWORK AND INTERNET 1372 | ; allow other network users to control or disable the shared internet connection 1373 | [HKEY_LOCAL_MACHINE\System\ControlSet001\Control\Network\SharedAccessConnection] 1374 | "EnableControl"=dword:00000001 1375 | 1376 | ; SYSTEM AND SECURITY 1377 | ; revert adjust for best performance of programs 1378 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\PriorityControl] 1379 | "Win32PrioritySeparation"=dword:00000002 1380 | 1381 | ; remote assistance 1382 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Remote Assistance] 1383 | "fAllowToGetHelp"=dword:00000001 1384 | 1385 | ; TROUBLESHOOTING 1386 | ; automatic maintenance 1387 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\Maintenance] 1388 | "MaintenanceDisabled"=- 1389 | 1390 | ; SECURITY AND MAINTENANCE 1391 | ; report problems 1392 | [-HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting] 1393 | 1394 | ; ACCOUNTS 1395 | ; use my sign in info after restart 1396 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System] 1397 | "DisableAutomaticRestartSignOn"=- 1398 | 1399 | ; APPS 1400 | ; archive apps 1401 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Appx] 1402 | "AllowAutomaticAppArchiving"=- 1403 | 1404 | ; PERSONALIZATION 1405 | 1406 | [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize] 1407 | 1408 | ; don't hide most used list in start menu 1409 | ; show recently added apps 1410 | [-HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer] 1411 | 1412 | ; news and interests 1413 | [-HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds] 1414 | 1415 | ; SYSTEM 1416 | ; hardware accelerated gpu scheduling 1417 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers] 1418 | "HwSchMode"=- 1419 | 1420 | ; storage sense 1421 | [-HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\StorageSense] 1422 | 1423 | ; --OTHER-- 1424 | ; Enable update Microsoft Store apps automatically 1425 | [-HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore] 1426 | 1427 | ; --CAN'T DO NATIVELY-- 1428 | ; UWP APPS 1429 | ; background apps 1430 | [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy] 1431 | "LetAppsRunInBackground"=- 1432 | 1433 | ; widgets 1434 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\default\NewsAndInterests\AllowNewsAndInterests] 1435 | "value"=dword:00000001 1436 | 1437 | ; NVIDIA 1438 | ; old nvidia sharpening 1439 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\nvlddmkm\FTS] 1440 | "EnableGR535"=dword:00000001 1441 | 1442 | ; OTHER 1443 | ; 3d objects 1444 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}] 1445 | [HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}] 1446 | 1447 | ; Restores Home Folder 1448 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{f874310e-b6b7-47dc-bc84-b9e6b38f5903}] 1449 | @="CLSID_MSGraphHomeFolder" 1450 | 1451 | [HKEY_USERS\.DEFAULT\Control Panel\Mouse] 1452 | "MouseSpeed"="1" 1453 | "MouseThreshold1"="6" 1454 | "MouseThreshold2"="10" 1455 | "@ 1456 | Set-Content -Path "$env:TEMP\Restore_LocalMachine_Registry.reg" -Value $MultilineComment -Force 1457 | # edit reg file 1458 | $path = "$env:TEMP\Restore_LocalMachine_Registry.reg" 1459 | (Get-Content $path) -replace "\?", "$" | Out-File $path 1460 | # import reg file 1461 | Regedit.exe /S "$env:TEMP\Restore_LocalMachine_Registry.reg" 1462 | Show-Header 1463 | Write-Host "Default Local Machine Registry Settings Applied." -ForegroundColor Green 1464 | Wait-IfNotSpecialize 1465 | } 1466 | 1467 | 1468 | function Set-RecommendedHKCURegistry { 1469 | Clear-Host 1470 | Write-Host "Optimizing User Registry . . ." 1471 | 1472 | # Set Wallpaper (Helper Function for Recommended User Settings) 1473 | $defaultWallpaperPath = "C:\Windows\Web\4K\Wallpaper\Windows\img0_3840x2160.jpg" 1474 | $darkModeWallpaperPath = "C:\Windows\Web\4K\Wallpaper\Windows\img19_1920x1200.jpg" 1475 | 1476 | function Set-Wallpaper ($wallpaperPath) { 1477 | reg.exe add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "$wallpaperPath" /f | Out-Null 1478 | # Notify the system of the change 1479 | rundll32.exe user32.dll, UpdatePerUserSystemParameters 1480 | } 1481 | 1482 | # Check Windows version 1483 | $windowsVersion = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").CurrentBuild 1484 | 1485 | # Apply appropriate wallpaper based on Windows version or existence of dark mode wallpaper 1486 | if ($windowsVersion -ge 22000) { 1487 | # Assuming Windows 11 starts at build 22000 1488 | if (Test-Path $darkModeWallpaperPath) { 1489 | Set-Wallpaper -wallpaperPath $darkModeWallpaperPath 1490 | } 1491 | } 1492 | else { 1493 | # Apply default wallpaper for Windows 10 1494 | Set-Wallpaper -wallpaperPath $defaultWallpaperPath 1495 | } 1496 | 1497 | $MultilineComment = @" 1498 | Windows Registry Editor Version 5.00 1499 | 1500 | ; EASE OF ACCESS 1501 | ; disable narrator 1502 | [HKEY_CURRENT_USER\Software\Microsoft\Narrator\NoRoam] 1503 | "DuckAudio"=dword:00000000 1504 | "WinEnterLaunchEnabled"=dword:00000000 1505 | "ScriptingEnabled"=dword:00000000 1506 | "OnlineServicesEnabled"=dword:00000000 1507 | "EchoToggleKeys"=dword:00000000 1508 | 1509 | ; disable narrator settings 1510 | [HKEY_CURRENT_USER\Software\Microsoft\Narrator] 1511 | "NarratorCursorHighlight"=dword:00000000 1512 | "CoupleNarratorCursorKeyboard"=dword:00000000 1513 | "IntonationPause"=dword:00000000 1514 | "ReadHints"=dword:00000000 1515 | "ErrorNotificationType"=dword:00000000 1516 | "EchoChars"=dword:00000000 1517 | "EchoWords"=dword:00000000 1518 | 1519 | [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Narrator\NarratorHome] 1520 | "MinimizeType"=dword:00000000 1521 | "AutoStart"=dword:00000000 1522 | 1523 | ; disable ease of access settings 1524 | [HKEY_CURRENT_USER\Software\Microsoft\Ease of Access] 1525 | "selfvoice"=dword:00000000 1526 | "selfscan"=dword:00000000 1527 | 1528 | [HKEY_CURRENT_USER\Control Panel\Accessibility] 1529 | "Sound on Activation"=dword:00000000 1530 | "Warning Sounds"=dword:00000000 1531 | 1532 | [HKEY_CURRENT_USER\Control Panel\Accessibility\HighContrast] 1533 | "Flags"="4194" 1534 | 1535 | [HKEY_CURRENT_USER\Control Panel\Accessibility\Keyboard Response] 1536 | "Flags"="2" 1537 | "AutoRepeatRate"="0" 1538 | "AutoRepeatDelay"="0" 1539 | 1540 | [HKEY_CURRENT_USER\Control Panel\Accessibility\MouseKeys] 1541 | "Flags"="130" 1542 | "MaximumSpeed"="39" 1543 | "TimeToMaximumSpeed"="3000" 1544 | 1545 | [HKEY_CURRENT_USER\Control Panel\Accessibility\StickyKeys] 1546 | "Flags"="2" 1547 | 1548 | [HKEY_CURRENT_USER\Control Panel\Accessibility\ToggleKeys] 1549 | "Flags"="34" 1550 | 1551 | [HKEY_CURRENT_USER\Control Panel\Accessibility\SoundSentry] 1552 | "Flags"="0" 1553 | "FSTextEffect"="0" 1554 | "TextEffect"="0" 1555 | "WindowsEffect"="0" 1556 | 1557 | [HKEY_CURRENT_USER\Control Panel\Accessibility\SlateLaunch] 1558 | "ATapp"="" 1559 | "LaunchAT"=dword:00000000 1560 | 1561 | ; CLOCK AND REGION 1562 | ; disable notify me when the clock changes 1563 | [HKEY_CURRENT_USER\Control Panel\TimeDate] 1564 | "DstNotification"=dword:00000000 1565 | 1566 | ; APPEARANCE AND PERSONALIZATION 1567 | ; open file explorer to this pc 1568 | ; show file name extensions 1569 | ; disable display file size information in folder tips 1570 | ; disable show pop-up description for folder and desktop items 1571 | ; disable show preview handlers in preview pane 1572 | ; disable show status bar 1573 | ; disable show sync provider notifications 1574 | ; disable use sharing wizard 1575 | ; disable animations in the taskbar 1576 | ; enable show thumbnails instead of icons 1577 | ; disable show translucent selection rectangle 1578 | ; disable use drop shadows for icon labels on the desktop 1579 | ; more pins personalization start 1580 | ; disable show account-related notifications 1581 | ; disable show recently opened items in start, jump lists and file explorer 1582 | ; left taskbar alignment 1583 | ; remove chat from taskbar 1584 | ; remove task view from taskbar 1585 | ; remove copilot from taskbar 1586 | ; disable show recommendations for tips shortcuts new apps and more 1587 | ; disable share any window from my taskbar 1588 | ; disable snap window settings - SnapAssist to JointResize Entries 1589 | ; alt tab open windows only 1590 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] 1591 | "LaunchTo"=dword:00000001 1592 | "HideFileExt"=dword:00000000 1593 | "FolderContentsInfoTip"=dword:00000000 1594 | "ShowInfoTip"=dword:00000000 1595 | "ShowPreviewHandlers"=dword:00000000 1596 | "ShowStatusBar"=dword:00000000 1597 | "ShowSyncProviderNotifications"=dword:00000000 1598 | "SharingWizardOn"=dword:00000000 1599 | "TaskbarAnimations"=dword:0 1600 | "IconsOnly"=dword:0 1601 | "ListviewAlphaSelect"=dword:0 1602 | "ListviewShadow"=dword:0 1603 | "Start_Layout"=dword:00000001 1604 | "Start_AccountNotifications"=dword:00000000 1605 | "Start_TrackDocs"=dword:00000000 1606 | "TaskbarAl"=dword:00000000 1607 | "TaskbarMn"=dword:00000000 1608 | "ShowTaskViewButton"=dword:00000000 1609 | "ShowCopilotButton"=dword:00000000 1610 | "Start_IrisRecommendations"=dword:00000000 1611 | "TaskbarSn"=dword:00000000 1612 | "SnapAssist"=dword:00000000 1613 | "DITest"=dword:00000000 1614 | "EnableSnapBar"=dword:00000000 1615 | "EnableTaskGroups"=dword:00000000 1616 | "EnableSnapAssistFlyout"=dword:00000000 1617 | "SnapFill"=dword:00000000 1618 | "JointResize"=dword:00000000 1619 | "MultiTaskingAltTabFilter"=dword:00000003 1620 | 1621 | ; hide frequent folders in quick access 1622 | ; disable show files from office.com 1623 | ; show all taskbar icons on Windows 10 1624 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer] 1625 | "ShowFrequent"=dword:00000000 1626 | "ShowCloudFilesInQuickAccess"=dword:00000000 1627 | "EnableAutoTray"=dword:00000000 1628 | 1629 | ; enable display full path in the title bar 1630 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState] 1631 | "FullPath"=dword:00000001 1632 | 1633 | ; HARDWARE AND SOUND 1634 | ; sound communications do nothing 1635 | [HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Audio] 1636 | "UserDuckingPreference"=dword:00000003 1637 | 1638 | ; disable enhance pointer precision 1639 | ; mouse fix (no accel with epp on) 1640 | [HKEY_CURRENT_USER\Control Panel\Mouse] 1641 | "MouseSpeed"="0" 1642 | "MouseThreshold1"="0" 1643 | "MouseThreshold2"="0" 1644 | "MouseSensitivity"="10" 1645 | "SmoothMouseXCurve"=hex:\ 1646 | 00,00,00,00,00,00,00,00,\ 1647 | C0,CC,0C,00,00,00,00,00,\ 1648 | 80,99,19,00,00,00,00,00,\ 1649 | 40,66,26,00,00,00,00,00,\ 1650 | 00,33,33,00,00,00,00,00 1651 | "SmoothMouseYCurve"=hex:\ 1652 | 00,00,00,00,00,00,00,00,\ 1653 | 00,00,38,00,00,00,00,00,\ 1654 | 00,00,70,00,00,00,00,00,\ 1655 | 00,00,A8,00,00,00,00,00,\ 1656 | 00,00,E0,00,00,00,00,00 1657 | 1658 | ; SYSTEM AND SECURITY 1659 | ; set appearance options to custom 1660 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects] 1661 | "VisualFXSetting"=dword:3 1662 | 1663 | ; disable animate controls and elements inside windows 1664 | ; disable fade or slide menus into view 1665 | ; disable fade or slide tooltips into view 1666 | ; disable fade out menu items after clicking 1667 | ; disable show shadows under mouse pointer 1668 | ; disable show shadows under windows 1669 | ; disable slide open combo boxes 1670 | ; disable smooth-scroll list boxes 1671 | ; enable smooth edges of screen fonts 1672 | ; 100% dpi scaling 1673 | ; disable fix scaling for apps 1674 | ; disable menu show delay 1675 | [HKEY_CURRENT_USER\Control Panel\Desktop] 1676 | "UserPreferencesMask"=hex(2):90,12,03,80,10,00,00,00 1677 | "FontSmoothing"="2" 1678 | "LogPixels"=dword:00000060 1679 | "Win8DpiScaling"=dword:00000001 1680 | "EnablePerProcessSystemDPI"=dword:00000000 1681 | "MenuShowDelay"="0" 1682 | 1683 | ; --IMMERSIVE CONTROL PANEL-- 1684 | ; PRIVACY 1685 | ; disable show me notification in the settings app 1686 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications] 1687 | "EnableAccountNotifications"=dword:00000000 1688 | 1689 | ; disable voice activation 1690 | [HKEY_CURRENT_USER\Software\Microsoft\Speech_OneCore\Settings\VoiceActivation\UserPreferenceForAllApps] 1691 | "AgentActivationEnabled"=dword:00000000 1692 | 1693 | [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Speech_OneCore\Settings\VoiceActivation\UserPreferenceForAllApps] 1694 | "AgentActivationLastUsed"=dword:00000000 1695 | 1696 | ; disable other devices 1697 | [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\bluetoothSync] 1698 | "Value"="Deny" 1699 | 1700 | ; disable let websites show me locally relevant content by accessing my language list 1701 | [HKEY_CURRENT_USER\Control Panel\International\User Profile] 1702 | "HttpAcceptLanguageOptOut"=dword:00000001 1703 | 1704 | ; disable let windows improve start and search results by tracking app launches 1705 | [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\EdgeUI] 1706 | "DisableMFUTracking"=dword:00000001 1707 | 1708 | ; disable personal inking and typing dictionary 1709 | [HKEY_CURRENT_USER\Software\Microsoft\InputPersonalization] 1710 | "RestrictImplicitInkCollection"=dword:00000001 1711 | "RestrictImplicitTextCollection"=dword:00000001 1712 | 1713 | [HKEY_CURRENT_USER\Software\Microsoft\InputPersonalization\TrainedDataStore] 1714 | "HarvestContacts"=dword:00000000 1715 | 1716 | [HKEY_CURRENT_USER\Software\Microsoft\Personalization\Settings] 1717 | "AcceptedPrivacyPolicy"=dword:00000000 1718 | 1719 | ; feedback frequency never 1720 | [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Siuf\Rules] 1721 | "NumberOfSIUFInPeriod"=dword:00000000 1722 | "PeriodInNanoSeconds"=- 1723 | 1724 | ; SEARCH 1725 | ; disable search highlights 1726 | ; disable search history 1727 | ; disable safe search 1728 | ; disable cloud content search for work or school account 1729 | ; disable cloud content search for microsoft account 1730 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\SearchSettings] 1731 | "IsDynamicSearchBoxEnabled"=dword:00000000 1732 | "IsDeviceSearchHistoryEnabled"=dword:00000000 1733 | "SafeSearchMode"=dword:00000000 1734 | "IsAADCloudSearchEnabled"=dword:00000000 1735 | "IsMSACloudSearchEnabled"=dword:00000000 1736 | 1737 | ; EASE OF ACCESS 1738 | ; disable magnifier settings 1739 | [HKEY_CURRENT_USER\SOFTWARE\Microsoft\ScreenMagnifier] 1740 | "FollowCaret"=dword:00000000 1741 | "FollowNarrator"=dword:00000000 1742 | "FollowMouse"=dword:00000000 1743 | "FollowFocus"=dword:00000000 1744 | 1745 | ; GAMING 1746 | ; disable game bar 1747 | [HKEY_CURRENT_USER\System\GameConfigStore] 1748 | "GameDVR_Enabled"=dword:00000000 1749 | 1750 | ; disable enable open xbox game bar using game controller 1751 | ; enable game mode 1752 | [HKEY_CURRENT_USER\Software\Microsoft\GameBar] 1753 | "UseNexusForGameBarEnabled"=dword:00000000 1754 | "AutoGameModeEnabled"=dword:00000001 1755 | 1756 | ; other settings 1757 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\GameDVR] 1758 | "AppCaptureEnabled"=dword:00000000 1759 | "AudioEncodingBitrate"=dword:0001f400 1760 | "AudioCaptureEnabled"=dword:00000000 1761 | "CustomVideoEncodingBitrate"=dword:003d0900 1762 | "CustomVideoEncodingHeight"=dword:000002d0 1763 | "CustomVideoEncodingWidth"=dword:00000500 1764 | "HistoricalBufferLength"=dword:0000001e 1765 | "HistoricalBufferLengthUnit"=dword:00000001 1766 | "HistoricalCaptureEnabled"=dword:00000000 1767 | "HistoricalCaptureOnBatteryAllowed"=dword:00000001 1768 | "HistoricalCaptureOnWirelessDisplayAllowed"=dword:00000001 1769 | "MaximumRecordLength"=hex(b):00,D0,88,C3,10,00,00,00 1770 | "VideoEncodingBitrateMode"=dword:00000002 1771 | "VideoEncodingResolutionMode"=dword:00000002 1772 | "VideoEncodingFrameRateMode"=dword:00000000 1773 | "EchoCancellationEnabled"=dword:00000001 1774 | "CursorCaptureEnabled"=dword:00000000 1775 | "VKToggleGameBar"=dword:00000000 1776 | "VKMToggleGameBar"=dword:00000000 1777 | "VKSaveHistoricalVideo"=dword:00000000 1778 | "VKMSaveHistoricalVideo"=dword:00000000 1779 | "VKToggleRecording"=dword:00000000 1780 | "VKMToggleRecording"=dword:00000000 1781 | "VKTakeScreenshot"=dword:00000000 1782 | "VKMTakeScreenshot"=dword:00000000 1783 | "VKToggleRecordingIndicator"=dword:00000000 1784 | "VKMToggleRecordingIndicator"=dword:00000000 1785 | "VKToggleMicrophoneCapture"=dword:00000000 1786 | "VKMToggleMicrophoneCapture"=dword:00000000 1787 | "VKToggleCameraCapture"=dword:00000000 1788 | "VKMToggleCameraCapture"=dword:00000000 1789 | "VKToggleBroadcast"=dword:00000000 1790 | "VKMToggleBroadcast"=dword:00000000 1791 | "MicrophoneCaptureEnabled"=dword:00000000 1792 | "SystemAudioGain"=hex(b):10,27,00,00,00,00,00,00 1793 | "MicrophoneGain"=hex(b):10,27,00,00,00,00,00,00 1794 | 1795 | ; TIME & LANGUAGE 1796 | ; disable show the voice typing mic button 1797 | ; disable typing insights 1798 | [HKEY_CURRENT_USER\Software\Microsoft\input\Settings] 1799 | "IsVoiceTypingKeyEnabled"=dword:00000000 1800 | "InsightsEnabled"=dword:00000000 1801 | 1802 | ; disable capitalize the first letter of each sentence 1803 | ; disable play key sounds as i type 1804 | ; disable add a period after i double-tap the spacebar 1805 | ; disable show key background 1806 | [HKEY_CURRENT_USER\Software\Microsoft\TabletTip\1.7] 1807 | "EnableAutoShiftEngage"=dword:00000000 1808 | "EnableKeyAudioFeedback"=dword:00000000 1809 | "EnableDoubleTapSpace"=dword:00000000 1810 | "IsKeyBackgroundEnabled"=dword:00000000 1811 | 1812 | ; PERSONALIZATION 1813 | ; dark theme 1814 | [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize] 1815 | "AppsUseLightTheme"=dword:00000000 1816 | "SystemUsesLightTheme"=dword:00000000 1817 | "EnableTransparency"=dword:00000001 1818 | 1819 | ; disable web search in start menu 1820 | [HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\Explorer] 1821 | "DisableSearchBoxSuggestions"=dword:00000001 1822 | 1823 | ; Remove meet now 1824 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer] 1825 | "NoStartMenuMFUprogramsList"=- 1826 | "NoInstrumentation"=- 1827 | "HideSCAMeetNow"=dword:00000001 1828 | 1829 | ; remove search from taskbar 1830 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search] 1831 | "SearchboxTaskbarMode"=dword:00000000 1832 | 1833 | ; disable use dynamic lighting on my devices 1834 | ; disable compatible apps in the forground always control lighting 1835 | ; disable match my windows accent color 1836 | [HKEY_CURRENT_USER\Software\Microsoft\Lighting] 1837 | "AmbientLightingEnabled"=dword:00000000 1838 | "ControlledByForegroundApp"=dword:00000000 1839 | "UseSystemAccentColor"=dword:00000000 1840 | 1841 | ; DEVICES 1842 | ; disable let windows manage my default printer 1843 | [HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows] 1844 | "LegacyDefaultPrinterMode"=dword:00000001 1845 | 1846 | ; disable write with your fingertip 1847 | [HKEY_CURRENT_USER\Software\Microsoft\TabletTip\EmbeddedInkControl] 1848 | "EnableInkingWithTouch"=dword:00000000 1849 | 1850 | ; SYSTEM 1851 | [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\DWM] 1852 | "UseDpiScaling"=dword:00000000 1853 | 1854 | ; disable variable refresh rate & enable optimizations for windowed games 1855 | [HKEY_CURRENT_USER\Software\Microsoft\DirectX\UserGpuPreferences] 1856 | "DirectXUserGlobalSettings"="SwapEffectUpgradeEnable=1;VRROptimizeEnable=0;" 1857 | 1858 | ; disable notifications 1859 | ; Disable Notifications on Lock Screen 1860 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\PushNotifications] 1861 | "ToastEnabled"=dword:00000000 1862 | "LockScreenToastEnabled"=dword:00000000 1863 | 1864 | ; Disable Allow Notifications to Play Sounds 1865 | ; Disable Notifications on Lock Screen 1866 | ; Disable Show Reminders and VoIP Calls Notifications on Lock Screen 1867 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings] 1868 | "NOC_GLOBAL_SETTING_ALLOW_NOTIFICATION_SOUND"=dword:00000000 1869 | "NOC_GLOBAL_SETTING_ALLOW_TOASTS_ABOVE_LOCK"=dword:00000000 1870 | "NOC_GLOBAL_SETTING_ALLOW_CRITICAL_TOASTS_ABOVE_LOCK"=dword:00000000 1871 | 1872 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.SecurityAndMaintenance] 1873 | "Enabled"=dword:00000000 1874 | 1875 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel] 1876 | "Enabled"=dword:00000000 1877 | 1878 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.CapabilityAccess] 1879 | "Enabled"=dword:00000000 1880 | 1881 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.StartupApp] 1882 | "Enabled"=dword:00000000 1883 | 1884 | [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\UserProfileEngagement] 1885 | "ScoobeSystemSettingEnabled"=dword:00000000 1886 | 1887 | ; disable suggested actions 1888 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\SmartActionPlatform\SmartClipboard] 1889 | "Disabled"=dword:00000001 1890 | 1891 | ; battery options optimize for video quality 1892 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\VideoSettings] 1893 | "VideoQualityOnBattery"=dword:00000001 1894 | 1895 | ; UWP Apps 1896 | ; disable windows input experience preload 1897 | [HKEY_CURRENT_USER\Software\Microsoft\input] 1898 | "IsInputAppPreloadEnabled"=dword:00000000 1899 | 1900 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Dsh] 1901 | "IsPrelaunchEnabled"=dword:00000000 1902 | 1903 | ; disable copilot 1904 | [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\WindowsCopilot] 1905 | "TurnOffWindowsCopilot"=dword:00000001 1906 | 1907 | ; DISABLE ADVERTISING & PROMOTIONAL 1908 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager] 1909 | "ContentDeliveryAllowed"=dword:00000000 1910 | "FeatureManagementEnabled"=dword:00000000 1911 | "OemPreInstalledAppsEnabled"=dword:00000000 1912 | "PreInstalledAppsEnabled"=dword:00000000 1913 | "PreInstalledAppsEverEnabled"=dword:00000000 1914 | "RotatingLockScreenEnabled"=dword:00000000 1915 | "RotatingLockScreenOverlayEnabled"=dword:00000000 1916 | "SilentInstalledAppsEnabled"=dword:00000000 1917 | "SlideshowEnabled"=dword:00000000 1918 | "SoftLandingEnabled"=dword:00000000 1919 | "SubscribedContent-310093Enabled"=dword:00000000 1920 | "SubscribedContent-314563Enabled"=dword:00000000 1921 | "SubscribedContent-338388Enabled"=dword:00000000 1922 | "SubscribedContent-338389Enabled"=dword:00000000 1923 | "SubscribedContent-338393Enabled"=dword:00000000 1924 | "SubscribedContent-353694Enabled"=dword:00000000 1925 | "SubscribedContent-353696Enabled"=dword:00000000 1926 | "SubscribedContent-353698Enabled"=dword:00000000 1927 | "SubscribedContentEnabled"=dword:00000000 1928 | "SystemPaneSuggestionsEnabled"=dword:00000000 1929 | 1930 | ; OTHER 1931 | ; remove gallery 1932 | [HKEY_CURRENT_USER\Software\Classes\CLSID\{e88865ea-0e1c-4e20-9aa6-edcd0212c87c}] 1933 | "System.IsPinnedToNameSpaceTree"=dword:00000000 1934 | 1935 | ; restore the classic context menu 1936 | [HKEY_CURRENT_USER\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32] 1937 | @="" 1938 | 1939 | ; removes OneDrive Setup 1940 | [-HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run] 1941 | "OneDriveSetup"=- 1942 | 1943 | ; Hides the Try New Outlook Button 1944 | [HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Options\General] 1945 | "HideNewOutlookToggle"=dword:00000000 1946 | "@ 1947 | Set-Content -Path "$env:TEMP\Optimize_User_Registry.reg" -Value $MultilineComment -Force 1948 | Regedit.exe /S "$env:TEMP\Optimize_User_Registry.reg" 1949 | Show-Header 1950 | Write-Host "Recommended User Registry Settings Applied." -ForegroundColor Green 1951 | Wait-IfNotSpecialize 1952 | } 1953 | 1954 | function Set-DefaultHKCURegistry { 1955 | Clear-Host 1956 | Write-Host "Restoring User Default Registry Settings . . ." 1957 | $MultilineComment = @" 1958 | Windows Registry Editor Version 5.00 1959 | 1960 | ; --LEGACY CONTROL PANEL-- 1961 | ; EASE OF ACCESS 1962 | ; narrator 1963 | [HKEY_CURRENT_USER\Software\Microsoft\Narrator\NoRoam] 1964 | "DuckAudio"=- 1965 | "WinEnterLaunchEnabled"=- 1966 | "ScriptingEnabled"=- 1967 | "OnlineServicesEnabled"=- 1968 | "EchoToggleKeys"=- 1969 | 1970 | ; narrator settings 1971 | [HKEY_CURRENT_USER\Software\Microsoft\Narrator] 1972 | "NarratorCursorHighlight"=- 1973 | "CoupleNarratorCursorKeyboard"=- 1974 | "IntonationPause"=- 1975 | "ReadHints"=- 1976 | "ErrorNotificationType"=- 1977 | "EchoChars"=- 1978 | "EchoWords"=- 1979 | 1980 | [-HKEY_CURRENT_USER\SOFTWARE\Microsoft\Narrator\NarratorHome] 1981 | 1982 | ; ease of access settings 1983 | [-HKEY_CURRENT_USER\Software\Microsoft\Ease of Access] 1984 | 1985 | [HKEY_CURRENT_USER\Control Panel\Accessibility] 1986 | "Sound on Activation"=- 1987 | "Warning Sounds"=- 1988 | 1989 | [HKEY_CURRENT_USER\Control Panel\Accessibility\HighContrast] 1990 | "Flags"="126" 1991 | 1992 | [HKEY_CURRENT_USER\Control Panel\Accessibility\Keyboard Response] 1993 | "Flags"="126" 1994 | "AutoRepeatRate"="500" 1995 | "AutoRepeatDelay"="1000" 1996 | 1997 | [HKEY_CURRENT_USER\Control Panel\Accessibility\MouseKeys] 1998 | "Flags"="62" 1999 | "MaximumSpeed"="80" 2000 | "TimeToMaximumSpeed"="3000" 2001 | 2002 | [HKEY_CURRENT_USER\Control Panel\Accessibility\StickyKeys] 2003 | "Flags"="510" 2004 | 2005 | [HKEY_CURRENT_USER\Control Panel\Accessibility\ToggleKeys] 2006 | "Flags"="62" 2007 | 2008 | [HKEY_CURRENT_USER\Control Panel\Accessibility\SoundSentry] 2009 | "Flags"="2" 2010 | "FSTextEffect"="0" 2011 | "TextEffect"="0" 2012 | "WindowsEffect"="1" 2013 | 2014 | [HKEY_CURRENT_USER\Control Panel\Accessibility\SlateLaunch] 2015 | "ATapp"="narrator" 2016 | "LaunchAT"=dword:00000001 2017 | 2018 | ; CLOCK AND REGION 2019 | ; notify me when the clock changes 2020 | [-HKEY_CURRENT_USER\Control Panel\TimeDate] 2021 | 2022 | ; APPEARANCE AND PERSONALIZATION 2023 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] 2024 | "LaunchTo"=- 2025 | "HideFileExt"=dword:00000001 2026 | "FolderContentsInfoTip"=- 2027 | "ShowInfoTip"=dword:00000001 2028 | "ShowPreviewHandlers"=- 2029 | "ShowStatusBar"=dword:00000001 2030 | "ShowSyncProviderNotifications"=- 2031 | "SharingWizardOn"=- 2032 | "TaskbarAnimations"=dword:1 2033 | "IconsOnly"=dword:0 2034 | "ListviewAlphaSelect"=dword:1 2035 | "ListviewShadow"=dword:1 2036 | "Start_Layout"=- 2037 | "Start_AccountNotifications"=- 2038 | "Start_TrackDocs"=- 2039 | "TaskbarAl"=- 2040 | "TaskbarMn"=- 2041 | "ShowTaskViewButton"=- 2042 | "ShowCopilotButton"=- 2043 | "Start_IrisRecommendations"=- 2044 | "TaskbarSn"=- 2045 | "SnapAssist"=- 2046 | "DITest"=- 2047 | "EnableSnapBar"=- 2048 | "EnableTaskGroups"=- 2049 | "EnableSnapAssistFlyout"=- 2050 | "SnapFill"=- 2051 | "JointResize"=- 2052 | "MultiTaskingAltTabFilter"=- 2053 | 2054 | ; frequent folders in quick access 2055 | ; show files from office.com 2056 | ; don't show all taskbar icons 2057 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer] 2058 | "ShowFrequent"=- 2059 | "ShowCloudFilesInQuickAccess"=- 2060 | "EnableAutoTray"=- 2061 | 2062 | ; display full path in the title bar 2063 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState] 2064 | "FullPath"=dword:00000000 2065 | 2066 | ; HARDWARE AND SOUND 2067 | ; sound communications 2068 | [HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Audio] 2069 | "UserDuckingPreference"=- 2070 | 2071 | ; enhance pointer precision 2072 | ; mouse (default accel with epp on) 2073 | [HKEY_CURRENT_USER\Control Panel\Mouse] 2074 | "MouseSpeed"="1" 2075 | "MouseThreshold1"="6" 2076 | "MouseThreshold2"="10" 2077 | "MouseSensitivity"="10" 2078 | "SmoothMouseXCurve"=hex:00,00,00,00,00,00,00,00,15,6e,00,00,00,00,00,00,00,40,\ 2079 | 01,00,00,00,00,00,29,dc,03,00,00,00,00,00,00,00,28,00,00,00,00,00 2080 | "SmoothMouseYCurve"=hex:00,00,00,00,00,00,00,00,fd,11,01,00,00,00,00,00,00,24,\ 2081 | 04,00,00,00,00,00,00,fc,12,00,00,00,00,00,00,c0,bb,01,00,00,00,00 2082 | 2083 | ; SYSTEM AND SECURITY 2084 | ; set appearance options 2085 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects] 2086 | "VisualFXSetting"=- 2087 | 2088 | ; animate controls and elements inside windows 2089 | ; fade or slide menus into view 2090 | ; fade or slide tooltips into view 2091 | ; fade out menu items after clicking 2092 | ; show shadows under mouse pointer 2093 | ; show shadows under windows 2094 | ; slide open combo boxes 2095 | ; smooth-scroll list boxes 2096 | ; smooth edges of screen fonts 2097 | ; dpi scaling 2098 | ; fix scaling for apps 2099 | ; menu show delay 2100 | [HKEY_CURRENT_USER\Control Panel\Desktop] 2101 | "UserPreferencesMask"=hex(2):9e,1e,07,80,12,00,00,00 2102 | "FontSmoothing"="2" 2103 | "LogPixels"=- 2104 | "Win8DpiScaling"=dword:00000000 2105 | "EnablePerProcessSystemDPI"=- 2106 | "MenuShowDelay"="400" 2107 | 2108 | ; --IMMERSIVE CONTROL PANEL-- 2109 | ; PRIVACY 2110 | ; show me notification in the settings app 2111 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications] 2112 | "EnableAccountNotifications"=- 2113 | 2114 | ; allow location override 2115 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CPSS\Store\UserLocationOverridePrivacySetting] 2116 | "Value"=dword:00000001 2117 | 2118 | ; voice activation 2119 | [-HKEY_CURRENT_USER\Software\Microsoft\Speech_OneCore\Settings] 2120 | 2121 | ; other devices 2122 | [-HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\bluetoothSync] 2123 | 2124 | ; let websites show me locally relevant content by accessing my language list 2125 | [HKEY_CURRENT_USER\Control Panel\International\User Profile] 2126 | "HttpAcceptLanguageOptOut"=- 2127 | 2128 | ; let windows improve start and search results by tracking app launches 2129 | [-HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\EdgeUI] 2130 | 2131 | ; personal inking and typing dictionary 2132 | [HKEY_CURRENT_USER\Software\Microsoft\InputPersonalization] 2133 | "RestrictImplicitInkCollection"=dword:00000000 2134 | "RestrictImplicitTextCollection"=dword:00000000 2135 | 2136 | [HKEY_CURRENT_USER\Software\Microsoft\InputPersonalization\TrainedDataStore] 2137 | "HarvestContacts"=dword:00000001 2138 | 2139 | [HKEY_CURRENT_USER\Software\Microsoft\Personalization\Settings] 2140 | "AcceptedPrivacyPolicy"=dword:00000001 2141 | 2142 | ; feedback frequency 2143 | [-HKEY_CURRENT_USER\SOFTWARE\Microsoft\Siuf] 2144 | 2145 | ; SEARCH 2146 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\SearchSettings] 2147 | "IsDynamicSearchBoxEnabled"=- 2148 | "IsDeviceSearchHistoryEnabled"=- 2149 | "SafeSearchMode"=- 2150 | "IsAADCloudSearchEnabled"=- 2151 | "IsMSACloudSearchEnabled"=- 2152 | 2153 | ; EASE OF ACCESS 2154 | ; magnifier settings 2155 | [HKEY_CURRENT_USER\SOFTWARE\Microsoft\ScreenMagnifier] 2156 | "FollowCaret"=- 2157 | "FollowNarrator"=- 2158 | "FollowMouse"=- 2159 | "FollowFocus"=- 2160 | 2161 | ; GAMING 2162 | ; game bar 2163 | [HKEY_CURRENT_USER\System\GameConfigStore] 2164 | "GameDVR_Enabled"=dword:00000000 2165 | 2166 | ; enable open xbox game bar using game controller 2167 | ; game mode 2168 | [HKEY_CURRENT_USER\Software\Microsoft\GameBar] 2169 | "UseNexusForGameBarEnabled"=- 2170 | "AutoGameModeEnabled"=- 2171 | 2172 | ; other settings 2173 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\GameDVR] 2174 | "AppCaptureEnabled"=- 2175 | "AudioEncodingBitrate"=- 2176 | "AudioCaptureEnabled"=- 2177 | "CustomVideoEncodingBitrate"=- 2178 | "CustomVideoEncodingHeight"=- 2179 | "CustomVideoEncodingWidth"=- 2180 | "HistoricalBufferLength"=- 2181 | "HistoricalBufferLengthUnit"=- 2182 | "HistoricalCaptureEnabled"=- 2183 | "HistoricalCaptureOnBatteryAllowed"=- 2184 | "HistoricalCaptureOnWirelessDisplayAllowed"=- 2185 | "MaximumRecordLength"=- 2186 | "VideoEncodingBitrateMode"=- 2187 | "VideoEncodingResolutionMode"=- 2188 | "VideoEncodingFrameRateMode"=- 2189 | "EchoCancellationEnabled"=- 2190 | "CursorCaptureEnabled"=- 2191 | "VKToggleGameBar"=- 2192 | "VKMToggleGameBar"=- 2193 | "VKSaveHistoricalVideo"=- 2194 | "VKMSaveHistoricalVideo"=- 2195 | "VKToggleRecording"=- 2196 | "VKMToggleRecording"=- 2197 | "VKTakeScreenshot"=- 2198 | "VKMTakeScreenshot"=- 2199 | "VKToggleRecordingIndicator"=- 2200 | "VKMToggleRecordingIndicator"=- 2201 | "VKToggleMicrophoneCapture"=- 2202 | "VKMToggleMicrophoneCapture"=- 2203 | "VKToggleCameraCapture"=- 2204 | "VKMToggleCameraCapture"=- 2205 | "VKToggleBroadcast"=- 2206 | "VKMToggleBroadcast"=- 2207 | "MicrophoneCaptureEnabled"=- 2208 | "SystemAudioGain"=- 2209 | "MicrophoneGain"=- 2210 | 2211 | ; TIME & LANGUAGE 2212 | ; show the voice typing mic button 2213 | ; typing insights 2214 | [HKEY_CURRENT_USER\Software\Microsoft\input\Settings] 2215 | "IsVoiceTypingKeyEnabled"=- 2216 | "InsightsEnabled"=- 2217 | 2218 | ; capitalize the first letter of each sentence 2219 | ; play key sounds as i type 2220 | ; add a period after i double-tap the spacebar 2221 | ; show key background 2222 | [HKEY_CURRENT_USER\Software\Microsoft\TabletTip\1.7] 2223 | "EnableAutoShiftEngage"=- 2224 | "EnableKeyAudioFeedback"=- 2225 | "EnableDoubleTapSpace"=- 2226 | "IsKeyBackgroundEnabled"=- 2227 | 2228 | ; PERSONALIZATION 2229 | ; light theme 2230 | [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize] 2231 | "AppsUseLightTheme"=dword:00000001 2232 | "SystemUsesLightTheme"=dword:00000001 2233 | 2234 | [-HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\Explorer] 2235 | 2236 | [-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer] 2237 | 2238 | ; search from taskbar 2239 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search] 2240 | "SearchboxTaskbarMode"=- 2241 | 2242 | ; meet now 2243 | [-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer] 2244 | 2245 | ; use dynamic lighting on my devices 2246 | ; compatible apps in the forground always control lighting 2247 | ; match my windows accent color 2248 | [HKEY_CURRENT_USER\Software\Microsoft\Lighting] 2249 | "AmbientLightingEnabled"=dword:00000001 2250 | "ControlledByForegroundApp"=- 2251 | "UseSystemAccentColor"=dword:00000001 2252 | 2253 | ; DEVICES 2254 | ; let windows manage my default printer 2255 | [HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows] 2256 | "LegacyDefaultPrinterMode"=dword:ffffffff 2257 | 2258 | ; write with your fingertip 2259 | [-HKEY_CURRENT_USER\Software\Microsoft\TabletTip\EmbeddedInkControl] 2260 | 2261 | ; SYSTEM 2262 | [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\DWM] 2263 | "UseDpiScaling"=- 2264 | 2265 | ; variable refresh rate & optimizations for windowed games 2266 | [HKEY_CURRENT_USER\Software\Microsoft\DirectX\UserGpuPreferences] 2267 | "DirectXUserGlobalSettings"=- 2268 | 2269 | ; Notification defaults 2270 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\PushNotifications] 2271 | "ToastEnabled"=- 2272 | "LockScreenToastEnabled"=- 2273 | 2274 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings] 2275 | "NOC_GLOBAL_SETTING_ALLOW_NOTIFICATION_SOUND"=- 2276 | "NOC_GLOBAL_SETTING_ALLOW_TOASTS_ABOVE_LOCK"=- 2277 | "NOC_GLOBAL_SETTING_ALLOW_CRITICAL_TOASTS_ABOVE_LOCK"=- 2278 | 2279 | [-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.SecurityAndMaintenance] 2280 | 2281 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel] 2282 | "Enabled"=- 2283 | 2284 | [-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.CapabilityAccess] 2285 | 2286 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.StartupApp] 2287 | "Enabled"=dword:00000000 2288 | 2289 | [-HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\UserProfileEngagement] 2290 | 2291 | ; suggested actions 2292 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\SmartActionPlatform\SmartClipboard] 2293 | "Disabled"=- 2294 | 2295 | ; battery options optimize 2296 | [-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\VideoSettings] 2297 | 2298 | ; UWP APPS 2299 | ; disable windows input experience preload 2300 | [HKEY_CURRENT_USER\Software\Microsoft\input] 2301 | "IsInputAppPreloadEnabled"=- 2302 | 2303 | [-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Dsh] 2304 | 2305 | ; copilot 2306 | [-HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\WindowsCopilot] 2307 | 2308 | ; ADVERTISING & PROMOTIONAL 2309 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager] 2310 | "ContentDeliveryAllowed"=dword:00000001 2311 | "FeatureManagementEnabled"=dword:00000001 2312 | "OemPreInstalledAppsEnabled"=dword:00000001 2313 | "PreInstalledAppsEnabled"=dword:00000001 2314 | "PreInstalledAppsEverEnabled"=dword:00000001 2315 | "RotatingLockScreenEnabled"=dword:00000001 2316 | "RotatingLockScreenOverlayEnabled"=dword:00000001 2317 | "SilentInstalledAppsEnabled"=dword:00000001 2318 | "SlideshowEnabled"=dword:00000001 2319 | "SoftLandingEnabled"=dword:00000001 2320 | "SubscribedContent-310093Enabled"=- 2321 | "SubscribedContent-314563Enabled"=- 2322 | "SubscribedContent-338388Enabled"=- 2323 | "SubscribedContent-338389Enabled"=- 2324 | "SubscribedContent-338393Enabled"=- 2325 | "SubscribedContent-353694Enabled"=- 2326 | "SubscribedContent-353696Enabled"=- 2327 | "SubscribedContent-353698Enabled"=- 2328 | "SubscribedContentEnabled"=dword:00000001 2329 | "SystemPaneSuggestionsEnabled"=dword:00000001 2330 | 2331 | ; OTHER 2332 | ; gallery 2333 | [-HKEY_CURRENT_USER\Software\Classes\CLSID\{e88865ea-0e1c-4e20-9aa6-edcd0212c87c}] 2334 | 2335 | ; context menu 2336 | [-HKEY_CURRENT_USER\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}] 2337 | "@ 2338 | Set-Content -Path "$env:TEMP\Restore_User_Registry.reg" -Value $MultilineComment -Force 2339 | Regedit.exe /S "$env:TEMP\Restore_User_Registry.reg" 2340 | Show-Header 2341 | Write-Host "Default User Registry Settings Applied." -ForegroundColor Green 2342 | Wait-IfNotSpecialize 2343 | } 2344 | # End of Registry Optimizations 2345 | 2346 | # Start of Tasks and Services Functions 2347 | # Start of Tasks and Services Functions 2348 | function Set-ServiceStartup { 2349 | # List of services to set to Disabled 2350 | $disabledServices = @( 2351 | 'AJRouter', 'AppVClient', 'AssignedAccessManagerSvc', 2352 | 'DiagTrack', 'DialogBlockingService', 'NetTcpPortSharing', 2353 | 'RemoteAccess', 'RemoteRegistry', 'shpamsvc', 2354 | 'ssh-agent', 'tzautoupdate', 'uhssvc', 2355 | 'UevAgentService' 2356 | ) 2357 | 2358 | # List of services to set to Manual 2359 | $manualServices = @( 2360 | 'ALG', 'AppIDSvc', 'AppMgmt', 'AppReadiness', 'AppXSvc', 'Appinfo', 2361 | 'AxInstSV', 'BDESVC', 'BITS', 'BTAGService', 'BcastDVRUserService_*', 2362 | 'Browser', 'CDPSvc', 'CDPUserSvc_*', 'COMSysApp', 'CaptureService_*', 2363 | 'CertPropSvc', 'ClipSVC', 'ConsentUxUserSvc_*', 'CscService', 'DcpSvc', 2364 | 'DevQueryBroker', 'DeviceAssociationBrokerSvc_*', 'DeviceAssociationService', 2365 | 'DeviceInstall', 'DevicePickerUserSvc_*', 'DevicesFlowUserSvc_*', 2366 | 'DisplayEnhancementService', 'DmEnrollmentSvc', 'DoSvc', 'DsSvc', 'DsmSvc', 2367 | 'EFS', 'EapHost', 'EntAppSvc', 'FDResPub', 'Fax', 'FrameServer', 2368 | 'FrameServerMonitor', 'GraphicsPerfSvc', 'HomeGroupListener', 2369 | 'HomeGroupProvider', 'HvHost', 'IEEtwCollectorService', 'IKEEXT', 2370 | 'InstallService', 'InventorySvc', 'IpxlatCfgSvc', 'KtmRm', 'LicenseManager', 2371 | 'LxpSvc', 'MSDTC', 'MSiSCSI', 'MapsBroker', 'McpManagementService', 2372 | 'MessagingService_*', 'MicrosoftEdgeElevationService', 2373 | 'MixedRealityOpenXRSvc', 'MsKeyboardFilter', 'NPSMSvc_*', 'NaturalAuthentication', 2374 | 'NcaSvc', 'NcbService', 'NcdAutoSetup', 'Netman', 'NgcCtnrSvc', 'NgcSvc', 2375 | 'NlaSvc', 'P9RdrService_*', 'PNRPAutoReg', 'PNRPsvc', 'PcaSvc', 'PeerDistSvc', 2376 | 'PenService_*', 'PerfHost', 'PhoneSvc', 'PimIndexMaintenanceSvc_*', 'PlugPlay', 2377 | 'PolicyAgent', 'PrintNotify', 'PrintWorkflowUserSvc_*', 'PushToInstall', 'QWAVE', 2378 | 'RasAuto', 'RasMan', 'RetailDemo', 'RmSvc', 'RpcLocator', 'SCPolicySvc', 2379 | 'SCardSvr', 'SDRSVC', 'SEMgrSvc', 'SecurityHealthService', 2380 | 'SensorDataService', 'SensorService', 'SensrSvc', 'SessionEnv', 2381 | 'SharedAccess', 'SharedRealitySvc', 'SmsRouter', 'SstpSvc', 2382 | 'StateRepository', 'StiSvc', 'StorSvc', 'TabletInputService', 'TapiSrv', 2383 | 'TextInputManagementService', 'TieringEngineService', 'TimeBroker', 2384 | 'TimeBrokerSvc', 'TokenBroker', 'TroubleshootingSvc', 'TrustedInstaller', 2385 | 'UI0Detect', 'UdkUserSvc_*', 'UmRdpService', 'UnistoreSvc_*', 2386 | 'UserDataSvc_*', 'UsoSvc', 'VSS', 'VacSvc', 'W32Time', 'WEPHOSTSVC', 2387 | 'WFDSConMgrSvc', 'WMPNetworkSvc', 'WManSvc', 'WPDBusEnum', 'WSService', 2388 | 'WSearch', 'WaaSMedicSvc', 'WalletService', 'WarpJITSvc', 'WbioSrvc', 2389 | 'WcsPlugInService', 'WdiServiceHost', 'WdiSystemHost', 'WebClient', 'Wecsvc', 2390 | 'WerSvc', 'WiaRpc', 'WinHttpAutoProxySvc', 'WinRM', 'WpcMonSvc', 2391 | 'WpnService', 'WwanSvc', 'XblAuthManager', 'XblGameSave', 'XboxGipSvc', 2392 | 'XboxNetApiSvc', 'autotimesvc', 'bthserv', 'camsvc', 'cbdhsvc_*', 2393 | 'cloudidsvc', 'dcsvc', 'defragsvc', 'diagnosticshub.standardcollector.service', 2394 | 'diagsvc', 'dmwappushservice', 'dot3svc', 'edgeupdate', 'edgeupdatem', 2395 | 'embeddedmode', 'fdPHost', 'fhsvc', 'hidserv', 'icssvc', 'lfsvc', 2396 | 'lltdsvc', 'lmhosts', 'msiserver', 'netprofm', 'p2pimsvc', 'p2psvc', 2397 | 'perceptionsimulation', 'pla', 'seclogon', 'smphost', 'spectrum', 2398 | 'sppsvc', 'svsvc', 'swprv', 'upnphost', 'vds', 'vm3dservice', 2399 | 'vmicguestinterface', 'vmicheartbeat', 'vmickvpexchange', 'vmicrdv', 2400 | 'vmicshutdown', 'vmictimesync', 'vmicvmsession', 'vmicvss', 'wbengine', 2401 | 'wcncsvc', 'webthreatdefsvc', 'wercplsupport', 'wisvc', 'wlidsvc', 2402 | 'wlpasvc', 'wmiApSrv', 'workfolderssvc', 'wuauserv', 'wudfsvc' 2403 | ) 2404 | 2405 | # Set the services in the disabledServices list to Disabled 2406 | foreach ($service in $disabledServices) { 2407 | try { 2408 | Set-Service -Name $service -StartupType Disabled -ErrorAction SilentlyContinue | Out-Null 2409 | } 2410 | catch { 2411 | Show-Header 2412 | Write-Host "Failed to set $service to Disabled: $_" -ForegroundColor Yellow 2413 | Wait-IfNotSpecialize 2414 | } 2415 | } 2416 | 2417 | # Set the services in the manualServices list to Manual 2418 | foreach ($service in $manualServices) { 2419 | try { 2420 | Set-Service -Name $service -StartupType Manual -ErrorAction SilentlyContinue | Out-Null 2421 | } 2422 | catch { 2423 | Show-Header 2424 | Write-Host "Failed to set $service to Manual: $_" -ForegroundColor Yellow 2425 | Wait-IfNotSpecialize 2426 | } 2427 | } 2428 | 2429 | Show-Header 2430 | Write-Host "Service startup types updated successfully." -ForegroundColor Green 2431 | Wait-IfNotSpecialize 2432 | } 2433 | 2434 | function Set-DefaultServices { 2435 | # Get all services that are not currently set to Automatic and revert them 2436 | $allServices = Get-Service | Where-Object { $_.StartType -ne 'Automatic' } 2437 | 2438 | $successCount = 0 2439 | foreach ($service in $allServices) { 2440 | try { 2441 | Show-Header 2442 | Write-Host "Setting services to Automatic where permissions are allowed. Please wait . . ." 2443 | # Set the service startup type to Automatic using Set-Service 2444 | Set-Service -Name $service.Name -StartupType Automatic 2>&1 | Out-Null 2445 | 2446 | # Forcibly set the startup type to Automatic using WMI as a fallback 2447 | $wmiService = Get-WmiObject -Class Win32_Service -Filter "Name='$($service.Name)'" 2>&1 | Out-Null 2448 | if ($wmiService) { 2449 | $result = $wmiService.ChangeStartMode("Automatic") 2>&1 | Out-Null 2450 | if ($result.ReturnValue -eq 0) { 2451 | $successCount++ 2452 | } 2453 | } 2454 | } 2455 | catch { 2456 | # Silently continue if a service fails 2457 | continue 2458 | } 2459 | } 2460 | Show-Header 2461 | Write-Host "Successfully set services to Automatic where permissions allowed." -ForegroundColor Green 2462 | Wait-IfNotSpecialize 2463 | } 2464 | 2465 | function Disable-ScheduledTasks { 2466 | # Define the list of scheduled tasks to disable 2467 | $scheduledTasks = @( 2468 | "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser", 2469 | "Microsoft\Windows\Application Experience\ProgramDataUpdater", 2470 | "Microsoft\Windows\Autochk\Proxy", 2471 | "Microsoft\Windows\Customer Experience Improvement Program\Consolidator", 2472 | "Microsoft\Windows\Customer Experience Improvement Program\UsbCeip", 2473 | "Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector", 2474 | "Microsoft\Windows\Feedback\Siuf\DmClient", 2475 | "Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload", 2476 | "Microsoft\Windows\Windows Error Reporting\QueueReporting", 2477 | "Microsoft\Windows\Application Experience\MareBackup", 2478 | "Microsoft\Windows\Application Experience\StartupAppTask", 2479 | "Microsoft\Windows\Application Experience\PcaPatchDbTask", 2480 | "Microsoft\Windows\Maps\MapsUpdateTask" 2481 | ) 2482 | 2483 | $successCount = 0 2484 | foreach ($task in $scheduledTasks) { 2485 | try { 2486 | # Disable the task without wildcards 2487 | schtasks /Change /TN $task /Disable 2>&1 | Out-Null 2488 | $successCount++ 2489 | } 2490 | catch { 2491 | # Silently continue if a task fails 2492 | continue 2493 | } 2494 | } 2495 | 2496 | Show-Header 2497 | Write-Host "Successfully disabled unneeded scheduled tasks." -ForegroundColor Green 2498 | Wait-IfNotSpecialize 2499 | } 2500 | 2501 | function Enable-ScheduledTasks { 2502 | # Define the list of scheduled tasks to enable (same as those to disable) 2503 | $scheduledTasks = @( 2504 | "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser", 2505 | "Microsoft\Windows\Application Experience\ProgramDataUpdater", 2506 | "Microsoft\Windows\Autochk\Proxy", 2507 | "Microsoft\Windows\Customer Experience Improvement Program\Consolidator", 2508 | "Microsoft\Windows\Customer Experience Improvement Program\UsbCeip", 2509 | "Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector", 2510 | "Microsoft\Windows\Feedback\Siuf\DmClient", 2511 | "Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload", 2512 | "Microsoft\Windows\Windows Error Reporting\QueueReporting", 2513 | "Microsoft\Windows\Application Experience\MareBackup", 2514 | "Microsoft\Windows\Application Experience\StartupAppTask", 2515 | "Microsoft\Windows\Application Experience\PcaPatchDbTask", 2516 | "Microsoft\Windows\Maps\MapsUpdateTask" 2517 | ) 2518 | 2519 | $successCount = 0 2520 | foreach ($task in $scheduledTasks) { 2521 | try { 2522 | # Disable the task without wildcards 2523 | schtasks /Change /TN $task /Disable 2>&1 | Out-Null 2524 | $successCount++ 2525 | } 2526 | catch { 2527 | # Silently continue if a task fails 2528 | continue 2529 | } 2530 | } 2531 | 2532 | Show-Header 2533 | Write-Host "Successfully Enabled Default scheduled tasks." -ForegroundColor Green 2534 | Wait-IfNotSpecialize 2535 | } 2536 | # End of Tasks and Services Functions 2537 | 2538 | # Start of Power Settings Functions 2539 | function Set-RecommendedPowerSettings { 2540 | Clear-Host 2541 | # Import and set Ultimate power plan 2542 | cmd /c "powercfg /duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61 99999999-9999-9999-9999-999999999999 >nul 2>&1 & powercfg /SETACTIVE 99999999-9999-9999-9999-999999999999 >nul 2>&1" 2543 | 2544 | # Get all power plans and delete them 2545 | powercfg /L | ForEach-Object { 2546 | if ($_ -match "^\s*Power Scheme GUID: (\S+)") { 2547 | $guid = $matches[1] 2548 | if ($guid -ne "99999999-9999-9999-9999-999999999999") { 2549 | cmd /c "powercfg /delete $guid" | Out-Null 2550 | } 2551 | } 2552 | } 2553 | 2554 | # Registry modifications 2555 | $regChanges = @( 2556 | 'HKLM\SYSTEM\CurrentControlSet\Control\Power /v HibernateEnabled /t REG_DWORD /d 0', # Disables hibernate 2557 | 'HKLM\SYSTEM\CurrentControlSet\Control\Power /v HibernateEnabledDefault /t REG_DWORD /d 0', # Disables default hibernate settings 2558 | 'HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings /v ShowLockOption /t REG_DWORD /d 0', # Hides the Lock option from the Power menu 2559 | 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings /v ShowSleepOption /t REG_DWORD /d 0', # Hides the Sleep option from the Power menu 2560 | 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power /v HiberbootEnabled /t REG_DWORD /d 0', # Disables Fast Startup (Hiberboot) 2561 | 'HKLM\SYSTEM\ControlSet001\Control\Power\PowerSettings\54533251-82be-4824-96c1-47b60b740d00\0cc5b647-c1df-4637-891a-dec35c318583 /v ValueMax /t REG_DWORD /d 0', # Unparks CPU cores by setting the maximum processor state 2562 | 'HKLM\SYSTEM\CurrentControlSet\Control\Power\PowerThrottling /v PowerThrottlingOff /t REG_DWORD /d 1', # Disables power throttling 2563 | 'HKLM\System\ControlSet001\Control\Power\PowerSettings\2a737441-1930-4402-8d77-b2bebba308a3\0853a681-27c8-4100-a2fd-82013e970683 /v Attributes /t REG_DWORD /d 2', # Unhides "Hub Selective Suspend Timeout" 2564 | 'HKLM\System\ControlSet001\Control\Power\PowerSettings\2a737441-1930-4402-8d77-b2bebba308a3\d4e98f31-5ffe-4ce1-be31-1b38b384c009 /v Attributes /t REG_DWORD /d 2' # Unhides "USB 3 Link Power Management" 2565 | ) 2566 | 2567 | 2568 | foreach ($reg in $regChanges) { 2569 | cmd /c "reg add `$reg` /f >nul 2>&1" 2570 | } 2571 | 2572 | # Modify Power Plan settings 2573 | $settings = @( 2574 | @{ 2575 | SubgroupGUID = "0012ee47-9041-4b5d-9b77-535fba8b1442" # Hard Disk 2576 | SettingGUIDs = @("6738e2c4-e8a5-4a42-b16a-e040e769756e") # Turn off hard disk after 2577 | }, 2578 | @{ 2579 | SubgroupGUID = "0d7dbae2-4294-402a-ba8e-26777e8488cd" # Desktop Background Settings 2580 | SettingGUIDs = @("309dce9b-bef4-4119-9921-a851fb12f0f4") # Slide show 2581 | }, 2582 | @{ 2583 | SubgroupGUID = "19cbb8fa-5279-450e-9fac-8a3d5fedd0c1" # Wireless Adapter Settings 2584 | SettingGUIDs = @("12bbebe6-58d6-4636-95bb-3217ef867c1a") # Power saving mode 2585 | }, 2586 | @{ 2587 | SubgroupGUID = "238c9fa8-0aad-41ed-83f4-97be242c8f20" # Sleep 2588 | SettingGUIDs = @( 2589 | "29f6c1db-86da-48c5-9fdb-f2b67b1f44da", # Sleep after 2590 | "94ac6d29-73ce-41a6-809f-6363ba21b47e", # Allow hybrid sleep 2591 | "9d7815a6-7ee4-497e-8888-515a05f02364", # Hibernate after 2592 | "bd3b718a-0680-4d9d-8ab2-e1d2b4ac806d" # Allow wake timers 2593 | ) 2594 | }, 2595 | @{ 2596 | SubgroupGUID = "2a737441-1930-4402-8d77-b2bebba308a3" # USB Settings 2597 | SettingGUIDs = @( 2598 | "0853a681-27c8-4100-a2fd-82013e970683", # USB selective suspend setting 2599 | "48e6b7a6-50f5-4782-a5d4-53bb8f07e226", # USB 3 Link Power Management 2600 | "d4e98f31-5ffe-4ce1-be31-1b38b384c009" # USB Hub Selective Suspend Timeout 2601 | ) 2602 | }, 2603 | @{ 2604 | SubgroupGUID = "501a4d13-42af-4429-9fd1-a8218c268e20" # PCI Express 2605 | SettingGUIDs = @("ee12f906-d277-404b-b6da-e5fa1a576df5") # Link State Power Management 2606 | }, 2607 | @{ 2608 | SubgroupGUID = "7516b95f-f776-4464-8c53-06167f40cc99" # Display settings 2609 | SettingGUIDs = @("3c0bc021-c8a8-4e07-a973-6b14cbcb2b7e") # Turn off Display After setting 2610 | } 2611 | ) 2612 | 2613 | 2614 | foreach ($group in $settings) { 2615 | $subgroup = $group.SubgroupGUID 2616 | foreach ($setting in $group.SettingGUIDs) { 2617 | powercfg /setacvalueindex 99999999-9999-9999-9999-999999999999 $subgroup $setting 0x00000000 2618 | powercfg /setdcvalueindex 99999999-9999-9999-9999-999999999999 $subgroup $setting 0x00000000 2619 | } 2620 | } 2621 | 2622 | if (-not $isSpecializePhase) { 2623 | Show-Header 2624 | Write-Host "Recommended Power Settings Applied." -ForegroundColor Green 2625 | Wait-IfNotSpecialize 2626 | return 2627 | } 2628 | } 2629 | 2630 | function Set-DefaultPowerSettings { 2631 | Clear-Host 2632 | # Restore default power plans and enable hibernate 2633 | powercfg -restoredefaultschemes 2634 | cmd /c "powercfg /hibernate on >nul 2>&1" 2635 | cmd /c "reg add `"HKLM\SYSTEM\CurrentControlSet\Control\Power`" /v `"HibernateEnabledDefault`" /t REG_DWORD /d `"1`" /f >nul 2>&1" 2636 | 2637 | # Registry modifications 2638 | $regChanges = @( 2639 | 'HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings /v ShowLockOption /t REG_DWORD /d 1', 2640 | 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings /v ShowSleepOption /t REG_DWORD /d 1', 2641 | 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power /v HiberbootEnabled /t REG_DWORD /d 1', 2642 | 'HKLM\SYSTEM\ControlSet001\Control\Power\PowerSettings\54533251-82be-4824-96c1-47b60b740d00\0cc5b647-c1df-4637-891a-dec35c318583 /v ValueMax /t REG_DWORD /d 100', 2643 | 'HKLM\System\ControlSet001\Control\Power\PowerSettings\2a737441-1930-4402-8d77-b2bebba308a3\0853a681-27c8-4100-a2fd-82013e970683 /v Attributes /t REG_DWORD /d 1', 2644 | 'HKLM\System\ControlSet001\Control\Power\PowerSettings\2a737441-1930-4402-8d77-b2bebba308a3\d4e98f31-5ffe-4ce1-be31-1b38b384c009 /v Attributes /t REG_DWORD /d 1' 2645 | ) 2646 | 2647 | foreach ($reg in $regChanges) { 2648 | cmd /c "reg add `$reg` /f >nul 2>&1" 2649 | } 2650 | 2651 | Show-Header 2652 | Write-Host "Default Power Settings Applied." -ForegroundColor Green 2653 | Wait-IfNotSpecialize 2654 | return 2655 | } 2656 | 2657 | # End of Power Settings Functions 2658 | 2659 | # END OF COMMAND & OPERATION FUNCTIONS 2660 | 2661 | # Check if this is running in the specialize phase to Apply Settings automatically during Windows Installation 2662 | if (Test-Path -Path $markerFilePath) { 2663 | # Bloatware Apps 2664 | Get-AppxProvisionedPackage -Online | 2665 | Where-Object { $appxPackages -contains $_.DisplayName } | 2666 | Remove-AppxProvisionedPackage -AllUsers -Online -ErrorAction SilentlyContinue 2667 | # Legacy Windows Features & Apps 2668 | Get-WindowsCapability -Online | 2669 | Where-Object { $capabilities -contains ($_.Name -split '~')[0] } | 2670 | Remove-WindowsCapability -Online -ErrorAction SilentlyContinue 2671 | # Additional Software & Apps 2672 | Set-AppsRegistry 2673 | Remove-OneDrive 2674 | Disable-Recall 2675 | # Privacy & Security 2676 | Set-RecommendedPrivacySettings 2677 | # Windows Updates 2678 | Set-RecommendedUpdateSettings 2679 | # Optimize Registry 2680 | Set-RecommendedHKLMRegistry 2681 | # Tasks and Services 2682 | Disable-ScheduledTasks 2683 | Set-ServiceStartup 2684 | # Power Settings 2685 | Set-RecommendedPowerSettings 2686 | exit 2687 | } 2688 | 2689 | # Main loop to keep showing the main menu 2690 | while ($script:loop) { 2691 | Show-MainMenu 2692 | } 2693 | --------------------------------------------------------------------------------