mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-06-04 14:17:27 +00:00
Remove OneDrive left overs (#4561)
* Update tweaks.json * Update tweaks.json
This commit is contained in:
@@ -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
|
||||||
"
|
"
|
||||||
|
|||||||
Reference in New Issue
Block a user