From 614eb949db7853cc70d6483705f2247decf12975 Mon Sep 17 00:00:00 2001 From: Gabi <218829269+GabiNun2@users.noreply.github.com> Date: Wed, 3 Jun 2026 21:08:18 +0300 Subject: [PATCH] Remove OneDrive left overs (#4561) * Update tweaks.json * Update tweaks.json --- config/tweaks.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config/tweaks.json b/config/tweaks.json index 285e877b..f5d580b1 100644 --- a/config/tweaks.json +++ b/config/tweaks.json @@ -667,13 +667,20 @@ # Some of OneDrive files use explorer, and OneDrive uses FileCoAuth Write-Host \"Removing leftover OneDrive Files...\" + Stop-Process -Name FileCoAuth,Explorer + Remove-Item \"$Env:LocalAppData\\Microsoft\\OneDrive\" -Recurse -Force Remove-Item \"C:\\ProgramData\\Microsoft OneDrive\" -Recurse -Force # Grant back permission to access OneDrive folder icacls $Env:OneDrive /grant \"Administrators:(D,DC)\" + if (-not (Get-ChildItem -Path $Env:OneDrive)) { + Remove-Item -Path $Env:OneDrive + [Environment]::SetEnvironmentVariable('OneDrive', $null, 'User') + } + # Disable OneSyncSvc Set-Service -Name OneSyncSvc -StartupType Disabled "