how to uninstall new "Windows Backup" bloat app?


Thanks for the testing @garlin 💕
I've updated the script and will attach it here.
However for me, it seems very hit and miss if it works now on my daily use PC! On my test VM it's great and works every time.

Powershell:
Param(     [Parameter(ValueFromPipelineByPropertyName)]$RemoveStartMenuItems = $True,
        [Parameter(ValueFromPipelineByPropertyName)]$RestartExplorer = $True )

Function Restart-Process
{
    Param(    [Parameter(ValueFromPipelineByPropertyName)]$Name,
            [Parameter(ValueFromPipelineByPropertyName)]$Wait,
            [Parameter(ValueFromPipelineByPropertyName)]$Timeout,
            [Parameter(ValueFromPipelineByPropertyName)]$Kill,
            [Parameter(ValueFromPipelineByPropertyName)]$Start )
    Process
    {
        If ( $Kill )
        {
            $szSystem32Path = [Environment]::GetFolderPath("System")
            $szTaskKillBinary = "$szSystem32Path\taskkill.exe"
            Write-Host -ForegroundColor White "Killing the process '$Name'..."
            # Note, stopping Explorer like this will cause it to not automatically restart
            Start-Process -WindowStyle Hidden -Wait -FilePath $szTaskKillBinary -ArgumentList "/F /IM $Name"
        }
        Else
        {
            Write-Host -ForegroundColor White "Stopping the process '$Name'..."
            Stop-Process -Name $Name -Force    # Note, stopping Explorer like this will cause it to automatically restart
            Write-Host -ForegroundColor White "Waiting for the process '$Name' to stop..."
            Wait-Process -Name $Name -Timeout $Timeout
        }
        If ( $Start )
        {
            Write-Host -ForegroundColor White "Starting the process '$Name'..."
            If ( $Name -Eq "explorer.exe" )
            {
                Start-Process -WindowStyle Hidden -FilePath "cmd" -ArgumentList "/c start /wait $Name"
            }
            Else
            {
                # Wait doesn't work on explorer
                Start-Process -WindowStyle Hidden -Wait -FilePath $Name
            }
        }
        $szNameWithoutExtension = [io.path]::GetFilenameWithoutExtension( $Name )
        Write-Host -ForegroundColor White "Waiting for the process '$szNameWithoutExtension' to start..."
        $iCount = 0
        While ( ((Get-Process -Name $szNameWithoutExtension -ErrorAction SilentlyContinue).Count -Eq 0) -And ($iCount -lt $Timeout) )
        {
            Start-Sleep -Seconds 1
            $iCount++
        }
        Write-Host -ForegroundColor White "Waiting $Wait seconds..."
        Start-Sleep -Seconds $Wait
    }
}

Function Remove_NonRemovablePackage
{
    Param(     [Parameter(ValueFromPipelineByPropertyName)]$Name )
    Process
    {
        $bRet = $False
        Write-Host -ForegroundColor White "Getting details for package '$Name'..."
        $objAppx = Get-AppxPackage -AllUsers -Name $Name
        If ( $Null -Ne $objAppx )
        {
            If ( $objAppx.Count -Gt 1 ) { $objAppx = $objAppx[0] }
            $szStoreRegKey = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore"
            $aszUserSIDs = @( "S-1-5-18" )
            If ( Test-Path -Path $szStoreRegKey )
            {
                $aszUserSIDs += $((Get-ChildItem -Path $szStoreRegKey -ErrorAction SilentlyContinue | Where {$_ -Like '*S-1-5-21*'}).PSChildName)
            }
            Write-Host -ForegroundColor White "Setting package '$($objAppx.PackageFamilyName)' to Deprovisioned..."
            $objDeprovisionedRegKey = New-Item -Force -Path "$szStoreRegKey\Deprovisioned\$objAppx.PackageFamilyName"
            ForEach ( $szUserSID in $aszUserSIDs )
            {
                Write-Host -ForegroundColor White "Setting package '$($objAppx.PackageFullName)' to End-of-life for user SID '$szUserSID'..."
                $objEOLRegKey = New-Item -Force -Path "$szStoreRegKey\EndOfLife\$szUserSID\$($objAppx.PackageFullName)"
            }
            Write-Host -ForegroundColor White "Removing package '$($objAppx.PackageFullName)' for all users..."
            $objRemovedPackage = Remove-AppxPackage -AllUsers -Package $($objAppx.PackageFullName)
            $bRet = $True
            Write-Host -ForegroundColor White "Waing a second..."
            Start-Sleep -Seconds 1
        }
        Else
        {
            Write-Host -ForegroundColor Red "ERROR: No package found called '$Name'."
        }
        Return $bRet
    }
}

Function Remove_StartMenuCBSItems
{
    Param( [Parameter(ValueFromPipelineByPropertyName)]$RestartExplorer )
    Process
    {
        $szCBSName = "MicrosoftWindows.Client.CBS"
        $szCBSAppName = "$($szCBSName)_cw5n1h2txyewy"
        $szWindowsPath = [Environment]::GetFolderPath( "Windows" )
        $szCBSXMLPath = "$szWindowsPath\SystemApps\$($szCBSAppName)\appxmanifest.xml"
        Write-Host -ForegroundColor White "Creating a backup of the Appx manifest file for '$szCBSAppName'..."
        $szCurrentTime = (Get-Date).ToString( "yyyy-MM-dd_HH-mm-ss" )
        $szBackFilePath = "$($szCBSXMLPath)_$($szCurrentTime).xml"
        Copy-Item -Force -Path $szCBSXMLPath -Destination "$($szCBSXMLPath)_$($szCurrentTime).xml"
        Write-Host -ForegroundColor White "Reading the Appx manifest file for '$szCBSAppName'..."
        $xmlCBS = [XML]( Get-Content $szCBSXMLPath )
        $xmlCBSNode = $xmlCBS.Package.Applications.Application | Where-Object { $_.Id -Eq "WebExperienceHost" }
        If ( $xmlCBSNode.VisualElements )
        {
            Write-Host -ForegroundColor White "Hiding the Start menu item 'Get Started'..."
            $xmlCBSNode.VisualElements.SetAttribute( "AppListEntry", "none" )
        }
        $xmlCBSNode = $xmlCBS.Package.Applications.Application | Where-Object { $_.Id -Eq "WindowsBackup" }
        If ( $xmlCBSNode.VisualElements )
        {
            Write-Host -ForegroundColor White "Hiding the Start menu item 'Windows Back up'..."
            $xmlCBSNode.VisualElements.SetAttribute( "AppListEntry", "none" )
        }
        $xmlCBSNode = $xmlCBS.Package.Applications.Application | Where-Object { $_.Id -Eq "CrossDeviceResumeApp" }
        If ( $xmlCBSNode.VisualElements )
        {
            Write-Host -ForegroundColor White "Hiding the Start menu item 'Continue from Phone'..."
            $xmlCBSNode.VisualElements.SetAttribute( "AppListEntry", "none" )
        }
        $szUser = "Administrators"
        $aclOrig = Get-Acl $szCBSXMLPath
        $aclPath = Get-Acl $szCBSXMLPath
        Write-Host -ForegroundColor White "Setting '$szUser' to have full control of '$szCBSXMLPath'..."
        $arPath = New-Object System.Security.AccessControl.FileSystemAccessRule( $szUser, "FullControl", $([System.Security.AccessControl.InheritanceFlags]::None), "None", "Allow" )
        $aclPath.SetAccessRule( $arPath )
        Set-Acl $szCBSXMLPath $aclPath
        Write-Host -ForegroundColor White "Saving the updated Appx manifest file for '$szCBSAppName'..."
        $objUTF8WithoutBOM = New-Object System.Text.UTF8Encoding( $False )
        $objUTF8WithoutBOMSW = New-Object System.IO.StreamWriter( $szCBSXMLPath, $False, $objUTF8WithoutBOM )
        $xmlCBS.Save( $objUTF8WithoutBOMSW )
        $objUTF8WithoutBOMSW.Close()
        $bRemoved = Remove_NonRemovablePackage -Name $szCBSName
        Write-Host -ForegroundColor White "Installing package '$szCBSAppName'..."
        Add-AppxPackage -ForceApplicationShutdown -DisableDevelopmentMode -Register $szCBSXMLPath
        Write-Host -ForegroundColor White "Waing a second..."
        Start-Sleep -Seconds 1
        If ( $RestartExplorer ) { Restart-Process -Name "explorer.exe" -Wait 0 -Timeout 5 -Kill:$True -Start:$True }
        Write-Host -ForegroundColor White "Restoring the original AppX manifest file..."
        Move-Item -Force -Path $szBackFilePath -Destination $szCBSXMLPath
        Write-Host -ForegroundColor White "Resetting permissions on '$szCBSXMLPath'..."
        Set-Acl $szCBSXMLPath $aclOrig
    }
}

Function Restore_StartMenuCBSItems
{
    Param( [Parameter(ValueFromPipelineByPropertyName)]$RestartExplorer )
    Process
    {
        $szCBSName = "MicrosoftWindows.Client.CBS"
        $szCBSAppName = "$($szCBSName)_cw5n1h2txyewy"
        $szWindowsPath = [Environment]::GetFolderPath( "Windows" )
        $szCBSXMLPath = "$szWindowsPath\SystemApps\$($szCBSAppName)\appxmanifest.xml"
        $bRemoved = Remove_NonRemovablePackage -Name $szCBSName
        Write-Host -ForegroundColor White "Installing package '$szCBSAppName'..."
        Add-AppxPackage -ForceApplicationShutdown -DisableDevelopmentMode -Register $szCBSXMLPath
        If ( $RestartExplorer ) { Restart-Process -Name "explorer.exe" -Wait 0 -Timeout 5 -Kill:$True -Start:$True }
    }
}

If ( $RemoveStartMenuItems )
{
    Remove_StartMenuCBSItems -RestartExplorer:$RestartExplorer
}
Else
{
    Restore_StartMenuCBSItems -RestartExplorer:$RestartExplorer
}
 

Attachments

My Computer My Computer

At a glance

Windows 11
OS
Windows 11
Remove Windows Backup App. (Copy in Terminal or Powershell)

$remove_appx = @("Client.CBS"); $provisioned = get-appxprovisionedpackage -online; $appxpackage = get-appxpackage -allusers; $eol = @()
$store = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore'
$users = @('S-1-5-18'); if (test-path $store) {$users += $((dir $store -ea 0 |where {$_ -like '*S-1-5-21*'}).PSChildName)}
foreach ($choice in $remove_appx) { if ('' -eq $choice.Trim()) {continue}
foreach ($appx in $($provisioned |where {$_.PackageName -like "*$choice*"})) {
$next = !1; foreach ($no in $skip) {if ($appx.PackageName -like "*$no*") {$next = !0}} ; if ($next) {continue}
$PackageName = $appx.PackageName; $PackageFamilyName = ($appxpackage |where {$_.Name -eq $appx.DisplayName}).PackageFamilyName
ni "$store\Deprovisioned\$PackageFamilyName" -force >''; $PackageFamilyName
foreach ($sid in $users) {ni "$store\EndOfLife\$sid\$PackageName" -force >''} ; $eol += $PackageName
dism /online /set-nonremovableapppolicy /packagefamily:$PackageFamilyName /nonremovable:0 >''
remove-appxprovisionedpackage -packagename $PackageName -online -allusers >''
}
foreach ($appx in $($appxpackage |where {$_.PackageFullName -like "*$choice*"})) {
$next = !1; foreach ($no in $skip) {if ($appx.PackageFullName -like "*$no*") {$next = !0}} ; if ($next) {continue}
$PackageFullName = $appx.PackageFullName;
ni "$store\Deprovisioned\$appx.PackageFamilyName" -force >''; $PackageFullName
foreach ($sid in $users) {ni "$store\EndOfLife\$sid\$PackageFullName" -force >''} ; $eol += $PackageFullName
dism /online /set-nonremovableapppolicy /packagefamily:$PackageFamilyName /nonremovable:0 >''
remove-appxpackage -package $PackageFullName -allusers >''
}
}
 

My Computer My Computer

At a glance

Windows 11
OS
Windows 11
Computer type
Laptop
Manufacturer/Model
HP
There are code tags for that.
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2 Build 26200.8894Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz32.0 GB of I forget and the box is in storage.Gigabyte nVidia GeForce GTX 1660 Super OC 6GB
    OS
    Windows 11 Pro 25H2 Build 26200.8894
    Computer type
    PC/Desktop
    Manufacturer/Model
    Sin-built 2013
    CPU
    Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz
    Motherboard
    ASUS ROG Maximus VI Formula
    Memory
    32.0 GB of I forget and the box is in storage.
    Graphics Card(s)
    Gigabyte nVidia GeForce GTX 1660 Super OC 6GB
    Sound Card
    ROG SupremeFX Formula 8-Channel High Definition Audio
    Monitor(s) Displays
    5 x LG 25MS500-B - 1 x 24MK430H-B - 1 x Wacom Pro 22" Touch Screen Tablet
    Screen Resolution
    All over the place
    Hard Drives
    Too many to list. OS on Samsung 1TB 870 QVO SATA
    PSU
    Silverstone 1500
    Case
    NZXT Phantom 820 Full-Tower Case
    Cooling
    Noctua NH-D15 Elite Class Dual Tower CPU Cooler / 6 x EziDIY 120mm / 2 x Corsair 140mm somethings / 1 x 140mm Thermaltake something / 2 x 200mm Corsair.
    Keyboard
    Corsair K95 / Logitech diNovo Edge Wireless
    Mouse
    Logitech: G402 / G502 / Mx Masters / Mx Air Cordless
    Internet Speed
    2000/500Mbps
    Browser
    All sorts
    Antivirus
    Kaspersky Premium
    Other Info
    ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
    TP-Link BE9300 WiFi 7 Bluetooth 5.4 (Archer TBE550E)
    TP-Link TX201 V1 2.5GB Lan

    Grandstream HT812 - VoIP
    ASUS DSL-AX82U - Mesh
    ASUS RT-AC68U - Mesh
    ASUS RT-BE88U Router

    Brother MFC-L2880DW Printer

    I’m on a horse.
  • At a glance

    Windows 11 Pro 25H2 Build 26200.8894 (Wifes)13th Generation Intel® Core™ i5-1340P Process...16GB LPDDR5-52001x Intel® Iris® Xe Graphics
    Operating System
    Windows 11 Pro 25H2 Build 26200.8894 (Wifes)
    Computer type
    Laptop
    Manufacturer/Model
    LENOVO Yoga 7 14IRL8 - Type 82YL
    CPU
    13th Generation Intel® Core™ i5-1340P Processor(Core™ i5-1340P)
    Memory
    16GB LPDDR5-5200
    Graphics card(s)
    1x Intel® Iris® Xe Graphics
    Sound Card
    Optimized with Dolby Atmos®
    Screen Resolution
    QHD 2880 x 1800 OLED
    Hard Drives
    M.2 512 GB SSD PCIe
    Mouse
    Logiteck MX Master 3S
    Internet Speed
    2000/500
    Antivirus
    Defender / Malwarebytes
    Other Info
    …still on a horse.


    Wireless Network: Wi-Fi 6E 2x2 AX; Bluetooth® 5.1 or above
    Ports: 1x 1 Novo button; 2 in 1 Audio Combo jack; Micro SD Card Reader; HDMI 1.4b; 2 x USB Type-C (TBT4)
    USB 3.2 Gen 2 DP 1.4a
    PD 3.0); 1 x USB 3.2 Gen1 Type A
    Camera
    1x 1080P FHD IR/RGB Hybrid with Privacy Shutter and Dual Array Microphone
    Graphics
    1x Intel® Iris® Xe Graphics
    Monitor
    14" WUXGA
    Form Factor
    Convertible Notebook
  • Windows 11 Pro 25H2 Build 26200.8894 (Wifes)

    Yoga 7 2-in-1 14IML9 - Type 83DJ

    Processor: Intel® Core™ Ultra 7 155H Processor(Core™ Ultra 7 155H)

    Memory: 32GB LPD5X-7467

    Hard Drive: 1 TB SSD PCIe

    Wireless Network: 1x Wi-Fi 6E 2x2 AX; Bluetooth® 5.1 or above

    Ports: 1 x HDMI 2.1 TMDS; 1 x Novo Button; 1 x Combo Audio Jack
    2 x USB-C (USB 4.0)
    1 x USB-A 3.2 Gen 1

    Camera: 1080P FHD IR Hybrid with Dual Microphone

    Graphics: Intel® Arc™ Graphics

    Monitor: 14" 2.8K

    ...Where's my horse?
It's been repeated many times, removing Client.CBS will break your desktop. Some users don't care about the broken features.

AveYo's code snippet is hideously overkill and can be simplified when removing one Appx package:
Code:
$appx = get-appxpackage -allusers *Client.CBS*
$PackageFamilyName = $appx.PackageFamilyName
$PackageFullName = $appx.PackageFullName; $PackageFullName

ni "$store\Deprovisioned\$PackageFamilyName" -force >''
dism /online /set-nonremovableapppolicy /packagefamily:$PackageFamilyName /nonremovable:0 >''

$store = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore'
$users = @('S-1-5-18')
$users += $((dir $store -ea 0 |where {$_ -like '*S-1-5-21*'}).PSChildName)

foreach ($sid in $users) { ni "$store\EndOfLife\$sid\$PackageFullName" -force >'' }
remove-appxpackage -package $PackageFullName -allusers >''
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
It's been repeated many times, removing Client.CBS will break your desktop. Some users don't care about the broken features.

AveYo's code snippet is hideously overkill and can be simplified when removing one Appx package:
Code:
$appx = get-appxpackage -allusers *Client.CBS*
$PackageFamilyName = $appx.PackageFamilyName
$PackageFullName = $appx.PackageFullName; $PackageFullName

ni "$store\Deprovisioned\$PackageFamilyName" -force >''
dism /online /set-nonremovableapppolicy /packagefamily:$PackageFamilyName /nonremovable:0 >''

$store = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore'
$users = @('S-1-5-18')
$users += $((dir $store -ea 0 |where {$_ -like '*S-1-5-21*'}).PSChildName)

foreach ($sid in $users) { ni "$store\EndOfLife\$sid\$PackageFullName" -force >'' }
remove-appxpackage -package $PackageFullName -allusers >''
Herein lies the risk of using amateur scripts without extensive testing and a good understanding of what the script does.

A decent script should be properly annotated with comments saying what next step does.

More importantly, it is funny how such script writers never advise users to make full system image backups or test in virtual machines etc.
 
Last edited:

My Computer My Computer

At a glance

Windows 11 Pro + Win11 Canary VM.I9 13th gen i9-13900H 2.60 GHZ16 GB solderedIntegrated Intel Iris XE
OS
Windows 11 Pro + Win11 Canary VM.
Computer type
Laptop
Manufacturer/Model
ASUS Zenbook 14
CPU
I9 13th gen i9-13900H 2.60 GHZ
Motherboard
Yep, Laptop has one.
Memory
16 GB soldered
Graphics Card(s)
Integrated Intel Iris XE
Sound Card
Realtek built in
Monitor(s) Displays
laptop OLED screen
Screen Resolution
2880x1800 touchscreen
Hard Drives
1 TB NVME SSD (only weakness is only one slot)
PSU
Internal + 65W thunderbolt USB4 charger
Case
Yep, got one
Cooling
Stella Artois (UK pint cans - 568 ml) - extra cost.
Keyboard
Built in UK keybd
Mouse
Bluetooth , wireless dongled, wired
Internet Speed
900 mbs (ethernet), wifi 6 typical 350-450 mb/s both up and down
Browser
Edge
Antivirus
Defender
Other Info
TPM 2.0, 2xUSB4 thunderbolt, 1xUsb3 (usb a), 1xUsb-c, hdmi out, 3.5 mm audio out/in combo, ASUS backlit trackpad (inc. switchable number pad)

Macrium Reflect Home V8
Office 365 Family (6 users each 1TB onedrive space)
Hyper-V (a vm runs almost as fast as my older laptop)
Thanks for the testing @garlin 💕
I've updated the script and will attach it here.
However for me, it seems very hit and miss if it works now on my daily use PC! On my test VM it's great and works every time.

Powershell:
Param(     [Parameter(ValueFromPipelineByPropertyName)]$RemoveStartMenuItems = $True,
        [Parameter(ValueFromPipelineByPropertyName)]$RestartExplorer = $True )

Function Restart-Process
{
    Param(    [Parameter(ValueFromPipelineByPropertyName)]$Name,
            [Parameter(ValueFromPipelineByPropertyName)]$Wait,
            [Parameter(ValueFromPipelineByPropertyName)]$Timeout,
            [Parameter(ValueFromPipelineByPropertyName)]$Kill,
            [Parameter(ValueFromPipelineByPropertyName)]$Start )
    Process
    {
        If ( $Kill )
        {
            $szSystem32Path = [Environment]::GetFolderPath("System")
            $szTaskKillBinary = "$szSystem32Path\taskkill.exe"
            Write-Host -ForegroundColor White "Killing the process '$Name'..."
            # Note, stopping Explorer like this will cause it to not automatically restart
            Start-Process -WindowStyle Hidden -Wait -FilePath $szTaskKillBinary -ArgumentList "/F /IM $Name"
        }
        Else
        {
            Write-Host -ForegroundColor White "Stopping the process '$Name'..."
            Stop-Process -Name $Name -Force    # Note, stopping Explorer like this will cause it to automatically restart
            Write-Host -ForegroundColor White "Waiting for the process '$Name' to stop..."
            Wait-Process -Name $Name -Timeout $Timeout
        }
        If ( $Start )
        {
            Write-Host -ForegroundColor White "Starting the process '$Name'..."
            If ( $Name -Eq "explorer.exe" )
            {
                Start-Process -WindowStyle Hidden -FilePath "cmd" -ArgumentList "/c start /wait $Name"
            }
            Else
            {
                # Wait doesn't work on explorer
                Start-Process -WindowStyle Hidden -Wait -FilePath $Name
            }
        }
        $szNameWithoutExtension = [io.path]::GetFilenameWithoutExtension( $Name )
        Write-Host -ForegroundColor White "Waiting for the process '$szNameWithoutExtension' to start..."
        $iCount = 0
        While ( ((Get-Process -Name $szNameWithoutExtension -ErrorAction SilentlyContinue).Count -Eq 0) -And ($iCount -lt $Timeout) )
        {
            Start-Sleep -Seconds 1
            $iCount++
        }
        Write-Host -ForegroundColor White "Waiting $Wait seconds..."
        Start-Sleep -Seconds $Wait
    }
}

Function Remove_NonRemovablePackage
{
    Param(     [Parameter(ValueFromPipelineByPropertyName)]$Name )
    Process
    {
        $bRet = $False
        Write-Host -ForegroundColor White "Getting details for package '$Name'..."
        $objAppx = Get-AppxPackage -AllUsers -Name $Name
        If ( $Null -Ne $objAppx )
        {
            If ( $objAppx.Count -Gt 1 ) { $objAppx = $objAppx[0] }
            $szStoreRegKey = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore"
            $aszUserSIDs = @( "S-1-5-18" )
            If ( Test-Path -Path $szStoreRegKey )
            {
                $aszUserSIDs += $((Get-ChildItem -Path $szStoreRegKey -ErrorAction SilentlyContinue | Where {$_ -Like '*S-1-5-21*'}).PSChildName)
            }
            Write-Host -ForegroundColor White "Setting package '$($objAppx.PackageFamilyName)' to Deprovisioned..."
            $objDeprovisionedRegKey = New-Item -Force -Path "$szStoreRegKey\Deprovisioned\$objAppx.PackageFamilyName"
            ForEach ( $szUserSID in $aszUserSIDs )
            {
                Write-Host -ForegroundColor White "Setting package '$($objAppx.PackageFullName)' to End-of-life for user SID '$szUserSID'..."
                $objEOLRegKey = New-Item -Force -Path "$szStoreRegKey\EndOfLife\$szUserSID\$($objAppx.PackageFullName)"
            }
            Write-Host -ForegroundColor White "Removing package '$($objAppx.PackageFullName)' for all users..."
            $objRemovedPackage = Remove-AppxPackage -AllUsers -Package $($objAppx.PackageFullName)
            $bRet = $True
            Write-Host -ForegroundColor White "Waing a second..."
            Start-Sleep -Seconds 1
        }
        Else
        {
            Write-Host -ForegroundColor Red "ERROR: No package found called '$Name'."
        }
        Return $bRet
    }
}

Function Remove_StartMenuCBSItems
{
    Param( [Parameter(ValueFromPipelineByPropertyName)]$RestartExplorer )
    Process
    {
        $szCBSName = "MicrosoftWindows.Client.CBS"
        $szCBSAppName = "$($szCBSName)_cw5n1h2txyewy"
        $szWindowsPath = [Environment]::GetFolderPath( "Windows" )
        $szCBSXMLPath = "$szWindowsPath\SystemApps\$($szCBSAppName)\appxmanifest.xml"
        Write-Host -ForegroundColor White "Creating a backup of the Appx manifest file for '$szCBSAppName'..."
        $szCurrentTime = (Get-Date).ToString( "yyyy-MM-dd_HH-mm-ss" )
        $szBackFilePath = "$($szCBSXMLPath)_$($szCurrentTime).xml"
        Copy-Item -Force -Path $szCBSXMLPath -Destination "$($szCBSXMLPath)_$($szCurrentTime).xml"
        Write-Host -ForegroundColor White "Reading the Appx manifest file for '$szCBSAppName'..."
        $xmlCBS = [XML]( Get-Content $szCBSXMLPath )
        $xmlCBSNode = $xmlCBS.Package.Applications.Application | Where-Object { $_.Id -Eq "WebExperienceHost" }
        If ( $xmlCBSNode.VisualElements )
        {
            Write-Host -ForegroundColor White "Hiding the Start menu item 'Get Started'..."
            $xmlCBSNode.VisualElements.SetAttribute( "AppListEntry", "none" )
        }
        $xmlCBSNode = $xmlCBS.Package.Applications.Application | Where-Object { $_.Id -Eq "WindowsBackup" }
        If ( $xmlCBSNode.VisualElements )
        {
            Write-Host -ForegroundColor White "Hiding the Start menu item 'Windows Back up'..."
            $xmlCBSNode.VisualElements.SetAttribute( "AppListEntry", "none" )
        }
        $xmlCBSNode = $xmlCBS.Package.Applications.Application | Where-Object { $_.Id -Eq "CrossDeviceResumeApp" }
        If ( $xmlCBSNode.VisualElements )
        {
            Write-Host -ForegroundColor White "Hiding the Start menu item 'Continue from Phone'..."
            $xmlCBSNode.VisualElements.SetAttribute( "AppListEntry", "none" )
        }
        $szUser = "Administrators"
        $aclOrig = Get-Acl $szCBSXMLPath
        $aclPath = Get-Acl $szCBSXMLPath
        Write-Host -ForegroundColor White "Setting '$szUser' to have full control of '$szCBSXMLPath'..."
        $arPath = New-Object System.Security.AccessControl.FileSystemAccessRule( $szUser, "FullControl", $([System.Security.AccessControl.InheritanceFlags]::None), "None", "Allow" )
        $aclPath.SetAccessRule( $arPath )
        Set-Acl $szCBSXMLPath $aclPath
        Write-Host -ForegroundColor White "Saving the updated Appx manifest file for '$szCBSAppName'..."
        $objUTF8WithoutBOM = New-Object System.Text.UTF8Encoding( $False )
        $objUTF8WithoutBOMSW = New-Object System.IO.StreamWriter( $szCBSXMLPath, $False, $objUTF8WithoutBOM )
        $xmlCBS.Save( $objUTF8WithoutBOMSW )
        $objUTF8WithoutBOMSW.Close()
        $bRemoved = Remove_NonRemovablePackage -Name $szCBSName
        Write-Host -ForegroundColor White "Installing package '$szCBSAppName'..."
        Add-AppxPackage -ForceApplicationShutdown -DisableDevelopmentMode -Register $szCBSXMLPath
        Write-Host -ForegroundColor White "Waing a second..."
        Start-Sleep -Seconds 1
        If ( $RestartExplorer ) { Restart-Process -Name "explorer.exe" -Wait 0 -Timeout 5 -Kill:$True -Start:$True }
        Write-Host -ForegroundColor White "Restoring the original AppX manifest file..."
        Move-Item -Force -Path $szBackFilePath -Destination $szCBSXMLPath
        Write-Host -ForegroundColor White "Resetting permissions on '$szCBSXMLPath'..."
        Set-Acl $szCBSXMLPath $aclOrig
    }
}

Function Restore_StartMenuCBSItems
{
    Param( [Parameter(ValueFromPipelineByPropertyName)]$RestartExplorer )
    Process
    {
        $szCBSName = "MicrosoftWindows.Client.CBS"
        $szCBSAppName = "$($szCBSName)_cw5n1h2txyewy"
        $szWindowsPath = [Environment]::GetFolderPath( "Windows" )
        $szCBSXMLPath = "$szWindowsPath\SystemApps\$($szCBSAppName)\appxmanifest.xml"
        $bRemoved = Remove_NonRemovablePackage -Name $szCBSName
        Write-Host -ForegroundColor White "Installing package '$szCBSAppName'..."
        Add-AppxPackage -ForceApplicationShutdown -DisableDevelopmentMode -Register $szCBSXMLPath
        If ( $RestartExplorer ) { Restart-Process -Name "explorer.exe" -Wait 0 -Timeout 5 -Kill:$True -Start:$True }
    }
}

If ( $RemoveStartMenuItems )
{
    Remove_StartMenuCBSItems -RestartExplorer:$RestartExplorer
}
Else
{
    Restore_StartMenuCBSItems -RestartExplorer:$RestartExplorer
}
thank you so much for this. but after use it auto installed both app. not work. i use in 24h2.
 

My Computer My Computer

At a glance

Windows 11
OS
Windows 11
Computer type
PC/Desktop
I'm starting to look at this again for work.
I've already fixed an issue that won't be an issue for most people. Having multiple service user accounts.. Just multiple accounts that may not have logged in is an issue currently.
I 'broke' my personal laptop running this script on it as is. It deprecated the CBS app for some people but not all. And Microsoft updates just failed after that. A big reinstall works but only when it's a major update like 24H2.
If you have a broken update scenario due to my script then get in touch. It's a case of removing certain registry keys the script creates to take out the CBS app. I'll look to make the script good in that respect.
Apologies if iv'e crippled anyone's systems. I did that to one of mine!
If I could remember off the top of my head the keys to remove I'd tell you. I'll need to look at things again to be specific.
As for it working for some and not others. I can now reproduce that so hopefully will be able to sort that out.
For me, a new system installs with no Windows updates it fails to work. A new system install with cumulative updates to be installed and install, the script works. Odd stuff, but I'll be on it again soon.
On leave next week but back on it then hopefully.
It's frustrating it works in some scenarios and not others!
For me, this isn't really a work ask, but more a thing I want to sort out for myself and you guys.
FYI: The script works on a April 2025 Win11 ISO (MSDN download) build with the cumulative Microsoft updates installed, But it doesn't work with the May 2025 Win11 ISO with no updates. ..The updates feel like the area to focus on.
Again, sorry if this has broken anyone's system.
Watch this space!
 
Last edited:

My Computer My Computer

At a glance

Windows 11
OS
Windows 11
I do not have a horse in this race but here's an observation.
While I would never use such a script, a lot of readers will read it without reading this entire 6 page thread. If any of the scripts have been proven to cripple a system, would it not be a smart thing to do to either flag this thread in some way or contact a forum admin to see the best way to deal with it. Just my 2 cents.
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2 26200.8875i9-10900 10 core 20 threads32 gbnone-Intel UHD Graphics 630
    OS
    Windows 11 Pro 25H2 26200.8875
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell Optiplex 7080
    CPU
    i9-10900 10 core 20 threads
    Motherboard
    DELL 0J37VM
    Memory
    32 gb
    Graphics Card(s)
    none-Intel UHD Graphics 630
    Sound Card
    Integrated Realtek
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    2x1tb Solidigm m.2 nvme /External drives 512gb Samsung m.2 sata+2tb Kingston m2.nvme
    PSU
    500w
    Case
    MT
    Cooling
    Dell Premium
    Keyboard
    Logitech wired
    Mouse
    Logitech wireless
    Internet Speed
    so slow I'm too embarrassed to tell
    Browser
    #1 Edge #2 Firefox
    Antivirus
    Defender+MWB Premium
  • At a glance

    Windows 11 Pro 24H2 26200.8875AMD Ryzen 7 6800U32 gbintegrated
    Operating System
    Windows 11 Pro 24H2 26200.8875
    Computer type
    PC/Desktop
    Manufacturer/Model
    Beelink Mini PC SER5
    CPU
    AMD Ryzen 7 6800U
    Memory
    32 gb
    Graphics card(s)
    integrated
    Sound Card
    integrated
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Crucial nvme
    Keyboard
    Logitech wired
    Mouse
    Logitech wireless
    Internet Speed
    still too embarrassed to tell
    Browser
    Firefox
    Antivirus
    Defender
    Other Info
    System 3 is non compliant Dell 9020 i7-4770/24gb ram Win11 PRO 26200.8875
Unfortunately users who are most likely to run “offbrand” scripts aren’t listening to words of caution. Removing Client.CBS just to remove the Backup icon is the least responsible solution, since fixing it requires a repair reinstall.

Tweaking the AppxManifest.xml (if done correctly) is a less obtrusive and reversible hack. The trick is in the exact details.
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
Just pretend it's not there!!! 🤷‍♂️
 

My Computers My Computers

  • At a glance

    Windows 11 Pro
    OS
    Windows 11 Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    ASUS ROG Strix
  • At a glance

    Windows 11 Pro
    Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    ASUS VivoBook
  • ASUS VivoBook 'Lite' ~ Windows 11 Home
17:00 Friday, end of the working week, perfect timing!
I reckon I've got it sorted after 3 days experimenting and a day making it nice for the average user!

I've put it in GitHub as it feels the best place to keep/maintain it:
 

My Computer My Computer

At a glance

Windows 11
OS
Windows 11
I've put it in GitHub as it feels the best place to keep/maintain it:
While you're mucking around the XML, can you also hide the pages for:
Global.FamilyValueProp​
Global.ValueBanner​

Those are the "nuisance" banners on Settings app, which do the upsell on MS online services. Same AppxManifest.xml.
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
I've not noticed those nags. But then I am doing all my testing using 'Enterprise N'.
I'll give it a look when I'm back on the clock! 😂🍻
Have a good weekend mate.
 

My Computer My Computer

At a glance

Windows 11
OS
Windows 11
By the way, did you try the script? Did it do the job for you?
 

My Computer My Computer

At a glance

Windows 11
OS
Windows 11
Sorry, haven't yet. Working on another previous project to auto-restore Classic Ribbon on a clean install. As you know, everything's in the details.
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
No worries G, and no rush. I'd just like to know if it works for others.

Yep, the Devil is in the detail! But that's where the fun/frustration lies! 😂
 

My Computer My Computer

At a glance

Windows 11
OS
Windows 11
Appears to work fine, the real test is when you apply the next round of Monthly or Preview Updates.
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
Thanks for testing it G.
I tested applying cumulative updates, there were issues to start with, with regards restoring. But I sorted that out. It's all about the version numbers.
Of course, when the updates get applied the patch will get removed. It's then just a case of running it again.
 

My Computer My Computer

At a glance

Windows 11
OS
Windows 11
I think if you're not well versed in the inner workings of Windows and script writing, running a script you see posted in a forum is probably not the safest or brightest idea. :-) The issue or Windows updates seems to be a major stumbling block, and worsens with the complexity of the script. It certainly seems that Microsoft can introduce all the problems that I need without me trying to change anything. :lmao:
 

My Computers My Computers

  • At a glance

    Win 11 Pro 25H2, Build 26200.8894Intel Core i5 1450064GB DDR4GeForce RTX 4060
    OS
    Win 11 Pro 25H2, Build 26200.8894
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home Brew
    CPU
    Intel Core i5 14500
    Motherboard
    Gigabyte B760M G P WIFI
    Memory
    64GB DDR4
    Graphics Card(s)
    GeForce RTX 4060
    Sound Card
    Chipset Realtek
    Monitor(s) Displays
    LG 45" Ultragear, Acer 24" 1080p
    Screen Resolution
    5120x1440, 1920x1080
    Hard Drives
    Crucial P310 2TB 2280 PCIe Gen4 3D NAND NVMe M.2 SSD (O/S)
    Silicon Power 2TB US75 NVMe PCIe Gen4 M.2 2280 SSD (backup)
    Crucial BX500 2TB 3D NAND (2nd backup)
    Seagate 4TB Ironwolf, rotating HDD archive files
    External off-line backup Drives: 2 NVMe 4TB drives in external enclosures
    PSU
    Thermaltake Toughpower GF3 750W
    Case
    LIAN LI LANCOOL 216 E-ATX PC Case
    Cooling
    Lots of fans!
    Keyboard
    Microsoft Comfort Curve 2000
    Mouse
    Logitech G305
    Internet Speed
    Verizon FiOS 1GB
    Browser
    Firefox
    Antivirus
    Malware Bytes & Windows Defender Security
  • At a glance

    Win 11 Pro 25H2, Build 26200.8894Intel Core i5 1440032GB DDR5Intel 700 Embedded GPU
    Operating System
    Win 11 Pro 25H2, Build 26200.8894
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home Brew
    CPU
    Intel Core i5 14400
    Motherboard
    Gigabyte B760M DS3H AX
    Memory
    32GB DDR5
    Graphics card(s)
    Intel 700 Embedded GPU
    Sound Card
    Realtek Embedded
    Monitor(s) Displays
    27" HP 1080p
    Screen Resolution
    1920x1080
    Hard Drives
    Crucial P310 2TB 2280 PCIe Gen4 eD NAND PCIe SSD
    Samsung EVO 990 2TB NVMe Gen4 SSD
    Samsung 2TB SATA SSD
    PSU
    Thermaltake Smart BM3 650W
    Case
    Okinos Micro ATX Case
    Cooling
    Fans
    Keyboard
    Microsoft Comfort Curve 2000
    Mouse
    Logitech G305
    Internet Speed
    Verizon FiOS 1GB
    Browser
    Firefox
    Antivirus
    Malware Bytes & Windows Defender Security
  • Nimo N171 17" Laptop, (Intel i3-1215U, 16GB RAM, 2TB NVMe, Win11 Pro)
    Acemagic Vista Mini PC V1 (Intel N150, 16GB RAM, 1TB NVMe, Win11 Pro)
    HP ENVY h8-1540t, (24GB RAM, 2TB SSD, 2TB HDD, Win11 Pro)
Quite rightly said by gunrunnerjohn
Use at your own risk. I did forget to say that.
I feel it does the job with safety nets.
But as always, have a look what the script does if you understand PowerShell. If not, it may be best not to run it.
 

My Computer My Computer

At a glance

Windows 11
OS
Windows 11
Back
Top Bottom