Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.comp.os.windows-10    |    Steaming pile of horseshit Windows 10    |    197,671 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 195,821 of 197,671    |
|    NewsKrawler to All    |
|    Re: cleanpc.bat script to clean hp strea    |
|    26 Nov 25 19:23:09    |
   
   From: newskrawl@krawl.org   
      
   On Wed, 26 Nov 2025 17:40:52 -0000 (UTC), NewsKrawler wrote:   
   Every piece of Windows bloat gets removed differently.   
      
      
   1. remove_appx_packages.bat   
    coordinates removal of unwanted Windows Store apps   
   2. remove_appx_provisioned.ps1   
    targets provisioned apps bundled into the Windows image   
    (which install automatically for new user accounts)   
   3. remove_appx_user.ps1   
    targets already-installed apps in existing user profiles   
      
    @echo off   
    :: Script Name : remove_appx_packages.bat   
    :: Version : 1.4 (auto-elevation + DisplayName filtering)   
    :: Date : 2025-11-26   
    :: Purpose :   
    :: Removes unwanted Windows Store apps (Appx packages) from the system.   
    :: Targets both:   
    :: 1. Provisioned apps (bundled into the Windows image)   
    :: 2. User apps (already installed in current accounts)   
    :: Auto-elevates to Administrator if not already.   
    :: Run this first to get the names:   
    :: Get-AppxProvisionedPackage -Online | Select-Object DisplayName, PackageName   
    :: Confirm provisioned appx packages:   
    :: Get-AppxProvisionedPackage -Online | Select-Object DisplayName   
      
    :: --- Auto-elevation check ---   
    net session >nul 2>&1   
    if %errorLevel% neq 0 (   
    echo Requesting administrator privileges...   
    powershell -Command "Start-Process '%~f0' -Verb RunAs"   
    exit /b   
    )   
      
    :: Remove provisioned (preinstalled for all users) apps   
    powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0remov   
   _appx_provisioned.ps1"   
      
    :: Remove apps already installed for current user accounts   
    powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0remov   
   _appx_user.ps1"   
      
    pause   
      
   ....................   
    # ============================================================================   
    # Script Name : remove_appx_provisioned.ps1   
    # Version : 1.6 (DisplayName filtering + cross-check + logging)   
    # Date : 2025-11-26   
    # Purpose :   
    # Removes provisioned Windows Store apps (Appx packages) from the Windows   
   image.   
    # Uses DisplayName filtering so version numbers don't need to be updated.   
    # Cross-checks against the actual provisioned list before removal to avoid   
   errors.   
    # Logs all actions to a file in the "logs" directory.   
    # ============================================================================   
      
    # --- Auto-elevation check ---   
    if (-not ([Security.Principal.WindowsPrincipal] [Security.Princ   
   pal.WindowsIdentity]::GetCurrent()   
    ).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {   
    Write-Host "Requesting administrator privileges..."   
    Start-Process powershell -ArgumentList "-NoProfile -ExecutionPolicy   
   Bypass -File `"$PSCommandPath`"" -Verb RunAs   
    exit   
    }   
      
    # --- Ensure logs directory exists ---   
    $logDir = Join-Path $PSScriptRoot "logs"   
    if (-not (Test-Path $logDir)) { New-Item -ItemType Directory -Path $logDir |   
   Out-Null }   
    $logFile = Join-Path $logDir ("provisioned_removal_{0:yyyyMMdd_HHmmss}.log"   
   -f (Get-Date))   
      
    # --- List of DisplayNames to remove ---   
    $appsToRemove = @(   
    "4DF9E0F8.Netflix",   
    "5A894077.McAfeeSecurity",   
    "AD2F1837.HPSupportAssistant",   
    "AD2F1837.myHP",   
    "C27EB4BA.DROPBOX",   
    "Microsoft.MicrosoftSolitaireCollection",   
    "Microsoft.OneConnect",   
    "Microsoft.Whiteboard",   
    "Microsoft.ZuneMusic",   
    "Microsoft.ZuneVideo"   
    )   
      
    # --- Get current provisioned packages ---   
    $provisioned = Get-AppxProvisionedPackage -Online   
      
    # --- Loop through target apps and remove only if present ---   
    foreach ($app in $appsToRemove) {   
    $match = $provisioned | Where-Object { $_.DisplayName -eq $app }   
    if ($match) {   
    $msg = "Removing provisioned package: $app"   
    Write-Host $msg   
    $msg | Out-File -FilePath $logFile -Append   
    Remove-AppxProvisionedPackage -Online -PackageName $match.PackageName   
    } else {   
    $msg = "Skipping $app (not provisioned in this image)"   
    Write-Host $msg   
    $msg | Out-File -FilePath $logFile -Append   
    }   
    }   
      
   .................   
    # ============================================================================   
    # Script Name : remove_appx_user.ps1   
    # Version : 1.6 (DisplayName filtering + cross-check + logging)   
    # Date : 2025-11-26   
    # Purpose :   
    # Removes Windows Store apps (Appx packages) from current user accounts.   
    # Targets already-installed copies of provisioned apps so they are removed   
    # from existing profiles, not just prevented for new ones.   
    # Uses DisplayName filtering for version-independence.   
    # Cross-checks against the installed list before removal to avoid errors.   
    # Logs all actions to a file in the "logs" directory.   
    # ============================================================================   
      
    # --- Auto-elevation check ---   
    if (-not ([Security.Principal.WindowsPrincipal] [Security.Princ   
   pal.WindowsIdentity]::GetCurrent()   
    ).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {   
    Write-Host "Requesting administrator privileges..."   
    Start-Process powershell -ArgumentList "-NoProfile -ExecutionPolicy   
   Bypass -File `"$PSCommandPath`"" -Verb RunAs   
    exit   
    }   
      
    # --- Ensure logs directory exists ---   
    $logDir = Join-Path $PSScriptRoot "logs"   
    if (-not (Test-Path $logDir)) { New-Item -ItemType Directory -Path $logDir |   
   Out-Null }   
    $logFile = Join-Path $logDir ("user_removal_{0:yyyyMMdd_HHmmss}.log" -f   
   (Get-Date))   
      
    # --- List of DisplayNames to remove ---   
    $appsToRemove = @(   
    "4DF9E0F8.Netflix",   
    "5A894077.McAfeeSecurity",   
    "AD2F1837.HPSupportAssistant",   
    "AD2F1837.myHP",   
    "C27EB4BA.DROPBOX",   
    "Microsoft.MicrosoftSolitaireCollection",   
    "Microsoft.OneConnect",   
    "Microsoft.Whiteboard",   
    "Microsoft.ZuneMusic",   
    "Microsoft.ZuneVideo"   
    )   
      
    # --- Get installed packages for all users ---   
    $installed = Get-AppxPackage -AllUsers   
      
    # --- Loop through target apps and remove only if present ---   
    foreach ($app in $appsToRemove) {   
    $match = $installed | Where-Object { $_.Name -eq $app }   
    if ($match) {   
    $msg = "Removing user package: $app"   
    Write-Host $msg   
    $msg | Out-File -FilePath $logFile -Append   
    foreach ($pkg in $match) {   
    Remove-AppxPackage -Package $pkg.PackageFullName -ErrorAction   
   SilentlyContinue   
    }   
    } else {   
    $msg = "Skipping $app (not installed for any user)"   
    Write-Host $msg   
    $msg | Out-File -FilePath $logFile -Append   
    }   
    }   
      
   --   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca