Remove OneDrive left overs (#4561)

* Update tweaks.json

* Update tweaks.json
This commit is contained in:
Gabi
2026-06-03 21:08:18 +03:00
committed by GitHub
parent d1edd5b2ba
commit 614eb949db
+7
View File
@@ -667,13 +667,20 @@
# Some of OneDrive files use explorer, and OneDrive uses FileCoAuth # Some of OneDrive files use explorer, and OneDrive uses FileCoAuth
Write-Host \"Removing leftover OneDrive Files...\" Write-Host \"Removing leftover OneDrive Files...\"
Stop-Process -Name FileCoAuth,Explorer Stop-Process -Name FileCoAuth,Explorer
Remove-Item \"$Env:LocalAppData\\Microsoft\\OneDrive\" -Recurse -Force Remove-Item \"$Env:LocalAppData\\Microsoft\\OneDrive\" -Recurse -Force
Remove-Item \"C:\\ProgramData\\Microsoft OneDrive\" -Recurse -Force Remove-Item \"C:\\ProgramData\\Microsoft OneDrive\" -Recurse -Force
# Grant back permission to access OneDrive folder # Grant back permission to access OneDrive folder
icacls $Env:OneDrive /grant \"Administrators:(D,DC)\" 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 # Disable OneSyncSvc
Set-Service -Name OneSyncSvc -StartupType Disabled Set-Service -Name OneSyncSvc -StartupType Disabled
" "