Forum Discussion
How do I completely disable OneDrive in Windows 11?
Windows includes a practical PowerShell script that you can use to how to disable onedrive on windows 11 via one-click batch execution, as well as complete related operations such as stopping background services and blocking automatic reinstallation of OneDrive.
Instructions: Create a new text document, paste the full provided PowerShell code, save the file and rename it remove-onedrive.ps1, right-click Windows Terminal and select Run as Administrator, navigate to the script storage folder and execute the script file, wait for the green success prompt to finish full OneDrive removal and disable setup.
# Stop and disable OneDrive
taskkill /f /im OneDrive.exe
Stop-Service -Name "OneDrive Updater Service" -Force
Set-Service -Name "OneDrive Updater Service" -StartupType Disabled
# Uninstall OneDrive
$onedrive = Get-AppxPackage *Microsoft.OneDrive*
Remove-AppxPackage -Package $onedrive
# Registry key to prevent reinstall
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "DisableFileSyncNGSC" -Value 1 -PropertyType DWORD -Force
Write-Host "OneDrive has been removed and disabled" -ForegroundColor GreenIts advantages include fully automated batch processing without repeated manual registry modification, simultaneously terminating processes, disabling update service and locking system registry, and requiring no extra third-party cleanup software.
Its drawbacks include mandatory administrator permission to run normally, possible execution failure due to Windows PowerShell execution policy restrictions, and occasional partial component recovery after large-scale official system updates.
This allows you to quickly finish how to disable onedrive on windows 11 in one operation. It is suitable for bulk system maintenance and one-time thorough OneDrive removal on Windows 11 devices, as well as for unified configuration for multiple computers.