All Tweaks

UI & Bloat Removal

Disable OneDrive

Prevents OneDrive from running and syncing.

Benefit

Stops unwanted cloud sync and background processes

Impact

medium

Commands (1)

Write-Host '--- Stopping OneDrive process ---'; Get-Process -Name OneDrive -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue; Start-Sleep -Milliseconds 500; Write-Host '--- Running OneDrive uninstaller ---'; $uninst = $null; foreach ($p in @("$env:SystemRoot\SysWOW64\OneDriveSetup.exe", "$env:SystemRoot\System32\OneDriveSetup.exe")) { if (Test-Path -LiteralPath $p) { $uninst = $p; break } } if ($uninst) { try { Start-Process -FilePath $uninst -ArgumentList '/uninstall' -Wait -ErrorAction Stop; Write-Host '[OK] OneDriveSetup /uninstall completed' } catch { Write-Host "[ERR] Uninstaller failed: $($_.Exception.Message)" } } else { Write-Host '[INFO] OneDriveSetup.exe not found (already removed or never installed)' } Write-Host '--- Removing leftover folders ---'; $paths = @("$env:LOCALAPPDATA\Microsoft\OneDrive", "$env:PROGRAMDATA\Microsoft OneDrive", "$env:SystemDrive\OneDriveTemp"); foreach ($p in $paths) { if (Test-Path -LiteralPath $p) { try { Remove-Item -Recurse -Force -LiteralPath $p -ErrorAction Stop; Write-Host "[OK] Removed $p" } catch { Write-Host "[WARN] Could not remove $p (in use)" } } } Write-Host '--- Removing Explorer integration ---'; $regPaths = @('HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{018D5C66-4533-4307-9B53-224DE2ED1FE6}', 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{018D5C66-4533-4307-9B53-224DE2ED1FE6}', 'HKCU:\Software\Classes\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}', 'HKLM:\SOFTWARE\Classes\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}'); foreach ($r in $regPaths) { if (Test-Path -LiteralPath $r) { Remove-Item -Recurse -Force -LiteralPath $r -ErrorAction SilentlyContinue } } Write-Host '--- Applying policy to prevent reinstall ---'; $pol = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive'; if (-not (Test-Path $pol)) { New-Item -Path $pol -Force | Out-Null } New-ItemProperty -Path $pol -Name 'DisableFileSyncNGSC' -PropertyType DWord -Value 1 -Force | Out-Null; New-ItemProperty -Path $pol -Name 'DisableFileSync' -PropertyType DWord -Value 1 -Force | Out-Null; Write-Host '[OK] OneDrive uninstalled and policy applied. Restart recommended.'

Warnings

  • This uninstalls OneDrive entirely. Local OneDrive folder files remain but won't sync. Sign out of OneDrive first if you have unsynced data.