Sycnex / Windows10Debloater

Script to remove Windows 10 bloatware.
MIT License
18.1k stars 2.05k forks source link

CloudStore removal fails to kill Explorer process #259

Open JerichoJones opened 4 years ago

JerichoJones commented 4 years ago

get-process explorer.exe fails because that is not the process name of Explorer.

Below is how I have modified my copy of this great script:

Write-Output "Removing CloudStore from registry if it exists"
$CloudStore = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\CloudStore'
If (Test-Path $CloudStore) {
    $procExplorer = get-process -Name Explorer
    Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name AutoRestartShell -Value 0
    $procExplorer.Kill()
    While (get-process Explorer -ErrorAction SilentlyContinue)
    {
        Start-Sleep -seconds 1
    }
    Remove-Item $CloudStore -Recurse -Force
    Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name AutoRestartShell -Value 1
    Start-Process Explorer.exe
}
mcsitter commented 4 years ago

This is the second issue for the same problem now, see #240 . Solutions have been proposed. In #240 @Blu3ish suggested changing Stop-Process Explorer.exe -Force to Stop-Process -Name explorer -Force

This seems to solve the issue so far as to prevent the error described in #240 to occur.