Skip to content

Could not find MicrosoftWindows.LKG.AccountsService\AppxManifest.xml when running #disable ai context menu extensions #201

@ptlambert

Description

@ptlambert

Describe the bug
When I enable only the first option in the GUI to Disable Registry Keys and then click Apply, it throws a pop-up error right after the section in the PowerShell console that says:
Disabling AI Experiment Program In Paint...

The error dialog says:
An error occurred: Could not find file C:\Windows\SystemApps\LKG\MicrosoftWindows.LKG.AccountsService_cw5n1h2txyew\AppxManifest.xml

Clicking OK to the error dialog reveals no further progress in the PowerShell console, however I am able to Cancel the GUI app at that point which cleanly terminates the script.

FYI, I downloaded and opened RemoveWindowsAi.ps1 in the PowerShell ISE and was able to force the Disable Registry Keys section to proceed to completion without any errors by snipping out this section of the script:

    #disable ai context menu extensions
    #these clsids are not always the same despite what most people seem to think when using this method so we need to get them for the user
    if ($revert) {
        $keys = Get-ItemProperty 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked' -ErrorAction SilentlyContinue  | Get-Member -ErrorAction SilentlyContinue | Where-Object { $_.Definition -like '*copilot*' -or $_.Definition -like '*designer*' }
        if ($keys) {
            foreach ($key in $keys) {
                Reg.exe delete 'HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked' /v "$($key.Name)" /f *>$null
            }
        }
    }
    else {
        $aiContextMenus = @(
            'AskM365Copilot'
            'AskCopilot'
            'CreateWithDesigner'
        )
        $contextMenuExtensions = (Get-AppxPackage -AllUsers | Get-AppxPackageManifest) | ForEach-Object { $_.package.Applications.Application.Extensions.Extension.FileExplorerContextMenus.itemtype.verb } | Select-Object  Id, Clsid -unique
        foreach ($ext in $contextMenuExtensions) {
            if ($aiContextMenus -contains $ext.Id) {
                Reg.exe add 'HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked' /v "{$($ext.Clsid)}" /t REG_SZ /d "$($ext.Id)" /f *>$null
            }
        }
    }

So something in this code block is triggering that error dialog...

To Reproduce
Run PowerShell as Admin, paste full "Launch with UI" command from GitHub into PowerShell console and press
Enter, wait for script GUI to appear, deselect all options except Disable Registry Keys, press Apply button, wait for the console to display:
Disabling AI Experiment Program In Paint...
... after which the error dialog is thrown:
An error occurred: Could not find file C:\Windows\SystemApps\LKG\MicrosoftWindows.LKG.AccountsService_cw5n1h2txyew\AppxManifext.xml

Screenshots
Screenshot of the error dialog:
Image

Desktop (open winver to see build):
Copied text from Settings > System > About:

Edition	Windows 11 IoT Enterprise LTSC
Version	24H2
Installed on	‎4/‎13/‎2026
OS build	26100.8246
Experience	Windows Feature Experience Pack 1000.26100.297.0

Additional context
This is Windows 11 IoT Enterprise LTSC 2024 which is very pared-down by default. I did not explicitly remove that "MicrosoftWindows.LKG.AccountsService" AppX package (nor any other packages) myself. However I do have the latest version of O&O ShutUp10++ version 2.x installed and nearly all items enabled, including all of the remediations on the "Copilot" tab. It's possible that O&O ShutUp10++ uninstalls some AppX packages via the options on that Copilot tab but I really don't know one way or another...

P.S. You are doing God's work here! (I just sent you a donation...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions