A PowerShell script to completely remove OneDrive from Windows, including all associated files, folders, registry entries, and scheduled tasks.
- This script requires administrator privileges to run properly.
- Ensure PowerShell 5.1 or higher is installed on your system.
-
Run PowerShell as Administrator:
- Press
Win + X
and chooseWindows PowerShell (Admin)
.
- Press
-
Execute the following commands:
Set-ExecutionPolicy Bypass -Scope Process -Force iwr -useb https://itsnileshhere.github.io/Onedrive-Removal/onedriveRemovalScript.ps1 | iex
The script will:
- Terminate OneDrive process.
- Uninstall OneDrive from system.
- Copy files from OneDrive to user profile folder.
- Remove OneDrive leftovers.
- Revert user folders back to their default locations.