Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

CloudStore removal fails to kill Explorer process #259

Open
JerichoJones opened this issue Jun 1, 2020 · 1 comment
Open

CloudStore removal fails to kill Explorer process #259

JerichoJones opened this issue Jun 1, 2020 · 1 comment

Comments

@JerichoJones
Copy link

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
Copy link
Contributor

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.

Sycnex added a commit that referenced this issue Mar 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants