Remove Windows AI

repository·main·Indexed 11 days ago

https://github.com/zoicware/removewindowsai

A PowerShell script for Windows 10 and 11 designed to strip AI-related features, components, and telemetry, including Copilot and Recall. It provides options to remove Appx and CBS packages, disable registry keys, prevent AI package reinstallation, and replace modern AI-integrated applications with classic versions of Notepad, Paint, and Photo Viewer.

Tokens
2.7K
Snippets
4
Records
12
Agent score
96%

What's inside Remove Windows AI

  1. Restore Classic Windows Apps

    main

    The script provides an option to replace modern AI-integrated apps with their classic versions. This includes:

    • Notepad
    • Paint
    • Photo Viewer
    • Photos Legacy (UWP Store app)

    The files for Mspaint and the Snipping Tool are extracted from Windows Server 2025 ISOs, as the Desktop Experience edition of Windows Server utilizes these classic versions.

  2. Understand how the script bypasses system restrictions

    main

    Because Microsoft restricts the removal of many AI components, the script employs several advanced PowerShell techniques and exploits to gain the necessary privileges:

    • Run-Trusted Function: Leverages an exploit to execute code under the TrustedInstaller.exe (Windows Module Installer) service. This allows the script to remove packages and items locked by System Privileges.
    • Appx Package Removal: Since many AI packages are marked as Non-Removeable, the script uses multiple methods to bypass this:
      • End of Life Trick: Adds the Package Family Name to HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\EndOfLife\USERSID to trick Windows into allowing removal. These entries are cleaned up after uninstallation to prevent Windows Update failures.
      • Deprovisioning: Adds the Package Family Name to HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned to prevent Windows Update from reinstalling the package.
      • Set-NonRemovableAppsPolicy: Uses a dism command with system privileges to attempt to strip the Non-Removeable property.
      • Removing Inbox Apps: Removes packages from HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\InboxApplications via Run-Trusted so Windows no longer recognizes them as protected Inbox Apps.
    • Hidden AI CBS Packages: To remove packages hidden from the standard dism command, the script modifies the Visibility key to 1 and removes the Owners and Updates subkeys within HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages.
  3. How the script handles specific AI features

    main

    The script targets several specific AI components and settings:

    • Copilot: Disables Copilot by modifying the IntegratedServicesRegionPolicySet JSON file (primarily affecting the EEA/European Economic Area) and setting all related policies to a disabled state.
    • Recall: Disables and removes the Recall optional feature, setting its state to DisabledWithPayloadRemoved. It also aggressively removes Recall's scheduled tasks by deleting both the files and registry entries using a system-privileged sub-script.
    • Notepad Rewrite: Disables the 'Rewrite' feature in Notepad using two methods: loading the settings.dat file from Notepad's AppData directory into the registry to set RewriteEnabled to false, and applying the official Microsoft policy.
    • Registry & Files: Cleans up registry keys for AI disablement in Notepad, Paint, and Edge. It also forcibly removes Appx package install locations, Machine Learning DLLs, and hidden Copilot installers.
    • Prevent Reinstall: Installs a custom Windows Update package that tricks Windows into believing a newer version of the AI package is already installed, preventing automatic re-installation.
  4. Disable AI features in Microsoft Office Apps

    main

    Certain AI features in Microsoft Office apps (often requiring an enterprise MS365 license) can be managed through app-specific settings. Note that using massgrave for personal use is recommended to avoid enabling Copilot in Office apps.

    Teams

    Navigate to: Settings -> Chats and Channels list -> Copilot

    Outlook

    In New Outlook, navigate to: Settings -> Copilot

    App Bar

    To remove the Copilot icon from the app bar: Right click Copilot icon in app bar -> uninstall

  5. Disable Windows Studio Effects

    main

    Windows Studio Effects are AI-powered features for the camera and microphone available on Copilot+ PCs (systems with an NPU). While the script may include a method to disable AI voice effects for the microphone, you should manually verify and disable camera/mic effects in your system settings.

    For detailed instructions on managing these effects, refer to the guide at: https://www.elevenforum.com/t/enable-or-disable-windows-studio-effects-for-camera-in-windows-11.39828/

  6. Check OS Support and Compatibility

    main

    The script is designed for the latest stable builds of Windows 10 and Windows 11.

    For the most effective removal of AI features, it is recommended to use one of the following Windows editions:

    • Pro
    • Enterprise
    • Server
    • Education

    Note on Home Editions: The script cannot guarantee 100% removal on Windows Home versions. If you are using a Home version and wish to convert to Pro, the author recommends using Microsoft-Activation-Scripts.

    Insider Builds

    The script is compatible with Windows Insider builds. However, please note that any new AI features introduced in Insider builds will not be supported by the script until they are officially released in the latest stable builds.

  7. Revert Changes made by the script

    main

    To undo the changes made by the script, use the -revertMode flag.

    NOTE

    To successfully revert, you should have run the script with -backupMode enabled during the initial execution, as this creates the necessary restore point.

    # Revert all changes
    & ([scriptblock]::Create((irm "https://raw.githubusercontent.com/zoicware/RemoveWindowsAI/main/RemoveWindowsAi.ps1"))) -nonInteractive -revertMode -AllOptions
  8. Run Remove Windows AI with the User Interface

    main

    To launch the script with a graphical user interface (UI), run the following command in a Windows PowerShell (5.1) console as an Administrator.

    WARNING

    Do not use PowerShell 7. Running the script with PowerShell 7 is unsupported and will cause issues. Ensure you are using the standard Windows PowerShell 5.1.

    You can use the full URL or the shortened version provided below.

    # Full URL
    & ([scriptblock]::Create((irm "https://raw.githubusercontent.com/zoicware/RemoveWindowsAI/main/RemoveWindowsAi.ps1")))
    
    # Compact Command
    & ([scriptblock]::Create((irm 'https://kutt.to/RWAI')))
  9. Troubleshooting: Antivirus False Positives

    main

    Because this script makes advanced system changes (modifying registry keys, removing system packages, and cleaning CBS stores), many third-party antivirus programs will flag it as malicious.

    Resolution:

    • This is a known false positive.
    • Temporarily disable your antivirus or add the script as an exclusion to allow it to run.
    • Recommendation: If you are unsure about the script's safety, test it in a virtual machine first.
  10. Install Classic Windows Applications

    main

    The script allows you to replace modern, AI-integrated Windows applications with their classic versions. Use the -InstallClassicApps flag followed by a comma-separated list of the apps you wish to install.

    Available Classic Apps

    • photoviewer
    • mspaint (Classic Paint)
    • snippingtool (Classic Snipping Tool)
    • notepad (Classic Notepad)
    • photoslegacy (Photos Legacy)
    # Example: Install classic Notepad, Paint, and Snipping Tool
    & ([scriptblock]::Create((irm "https://raw.githubusercontent.com/zoicware/RemoveWindowsAI/main/RemoveWindowsAi.ps1"))) -nonInteractive -InstallClassicApps photoviewer,mspaint,snippingtool,notepad
  11. Use Command Line Options for Automated Execution

    main

    The script can be run in non-interactive mode using specific flags to automate the removal process. This is useful for headless environments or predefined configurations.

    Common Execution Patterns

    • Run all options automatically: Use -nonInteractive -AllOptions.
    • Run specific options: Use -nonInteractive -Options <Option1>,<Option2>.
    • Exclude specific options: Use -nonInteractive -ExcludeOptions -Options <Option1>,<Option2>.
    • Enable Backup Mode: Use -nonInteractive -backupMode -AllOptions. This creates a system restore point, which is required if you intend to use the revertMode later.

    Available Removal Options

    OptionDescription
    DisableRegKeysDisables registry keys for Copilot, Recall, Edge, etc.
    PreventAIPackageReinstallInstalls a custom Windows Update package to prevent AI package reinstallation.
    DisableCopilotPoliciesDisables policies related to Copilot and Recall in IntegratedServicesRegionPolicySet.json.
    RemoveAppxPackagesRemoves AI appx packages (including Nonremovable and WindowsWorkload).
    RemoveRecallFeatureRemoves the Recall optional feature.
    RemoveCBSPackagesRemoves hidden/locked AI packages in the CBS store.
    RemoveAIFilesPerforms full system cleanup of installers, registry keys, and package files.
    HideAIComponentsHides the AI Components settings page.
    DisableRewriteDisables the Rewrite AI feature in Notepad.
    RemoveWindowsAITasksForcibly removes Windows AI scheduled tasks.
    UpdateCleanupCheckCreates a scheduled task to check for and remove newly installed AI features after Windows updates.
    RemoveCBSPackagesRemoves hidden and locked AI packages in the CBS store.
    # Run with specific options
    & ([scriptblock]::Create((irm "https://raw.githubusercontent.com/zoicware/RemoveWindowsAI/main/RemoveWindowsAi.ps1"))) -nonInteractive -Options DisableRegKeys,RemoveAppxPackages,DisableCopilotPolicies
    
    # Run with specific options excluded
    & ([scriptblock]::Create((irm "https://raw.githubusercontent.com/zoicware/RemoveWindowsAI/main/RemoveWindowsAi.ps1"))) -nonInteractive -ExcludeOptions -Options DisableRegKeys,RemoveAppxPackages,DisableCopilotPolicies