W4RH4WK / Debloat-Windows-10

A Collection of Scripts Which Disable / Remove Windows 10 Features and Apps
Other
6.02k stars 853 forks source link

OneDrive disable erroring #11

Closed 0xallie closed 8 years ago

0xallie commented 8 years ago

Using the latest git master. I'm running PowerShell as admin, of course. Windows 10 Home 64-bit.

PS D:\Downloads\Apps\Debloat-Windows-10\scripts> .\remove-onedrive.ps1
Kill OneDrive process
ERROR: The process "OneDrive.exe" not found.
SUCCESS: The process "explorer.exe" with PID 4264 has been terminated.
Remove OneDrive
Removing OneDrive leftovers
rm : Cannot remove item C:\Users\nyuszika7h\AppData\Local\Microsoft\OneDrive\17.3.5907.0716\amd64\FileSyncShell64.dll:
Access to the path 'FileSyncShell64.dll' is denied.
At D:\Downloads\Apps\Debloat-Windows-10\scripts\remove-onedrive.ps1:19 char:1
+ rm -r -Force "$env:localappdata\Microsoft\OneDrive"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (FileSyncShell64.dll:FileInfo) [Remove-Item], UnauthorizedAccessExcept
   ion
    + FullyQualifiedErrorId : RemoveFileSystemItemUnAuthorizedAccess,Microsoft.PowerShell.Commands.RemoveItemCommand
rm : Cannot remove item C:\Users\nyuszika7h\AppData\Local\Microsoft\OneDrive\17.3.5907.0716\amd64: The directory is
not empty.
At D:\Downloads\Apps\Debloat-Windows-10\scripts\remove-onedrive.ps1:19 char:1
+ rm -r -Force "$env:localappdata\Microsoft\OneDrive"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (amd64:DirectoryInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : RemoveFileSystemItemIOError,Microsoft.PowerShell.Commands.RemoveItemCommand
rm : Cannot remove item C:\Users\nyuszika7h\AppData\Local\Microsoft\OneDrive\17.3.5907.0716\FileSyncShell.dll: Access
to the path 'FileSyncShell.dll' is denied.
At D:\Downloads\Apps\Debloat-Windows-10\scripts\remove-onedrive.ps1:19 char:1
+ rm -r -Force "$env:localappdata\Microsoft\OneDrive"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (FileSyncShell.dll:FileInfo) [Remove-Item], UnauthorizedAccessExceptio
   n
    + FullyQualifiedErrorId : RemoveFileSystemItemUnAuthorizedAccess,Microsoft.PowerShell.Commands.RemoveItemCommand
rm : Cannot remove item C:\Users\nyuszika7h\AppData\Local\Microsoft\OneDrive\17.3.5907.0716\LoggingPlatform.dll:
Access to the path 'LoggingPlatform.dll' is denied.
At D:\Downloads\Apps\Debloat-Windows-10\scripts\remove-onedrive.ps1:19 char:1
+ rm -r -Force "$env:localappdata\Microsoft\OneDrive"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (LoggingPlatform.dll:FileInfo) [Remove-Item], UnauthorizedAccessExcept
   ion
    + FullyQualifiedErrorId : RemoveFileSystemItemUnAuthorizedAccess,Microsoft.PowerShell.Commands.RemoveItemCommand
rm : Cannot remove item C:\Users\nyuszika7h\AppData\Local\Microsoft\OneDrive\17.3.5907.0716\Telemetry.dll: Access to
the path 'Telemetry.dll' is denied.
At D:\Downloads\Apps\Debloat-Windows-10\scripts\remove-onedrive.ps1:19 char:1
+ rm -r -Force "$env:localappdata\Microsoft\OneDrive"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (Telemetry.dll:FileInfo) [Remove-Item], UnauthorizedAccessException
    + FullyQualifiedErrorId : RemoveFileSystemItemUnAuthorizedAccess,Microsoft.PowerShell.Commands.RemoveItemCommand
rm : Cannot remove item C:\Users\nyuszika7h\AppData\Local\Microsoft\OneDrive\17.3.5907.0716: The directory is not
empty.
At D:\Downloads\Apps\Debloat-Windows-10\scripts\remove-onedrive.ps1:19 char:1
+ rm -r -Force "$env:localappdata\Microsoft\OneDrive"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (17.3.5907.0716:DirectoryInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : RemoveFileSystemItemIOError,Microsoft.PowerShell.Commands.RemoveItemCommand
rm : Cannot remove item C:\Users\nyuszika7h\AppData\Local\Microsoft\OneDrive: The directory is not empty.
At D:\Downloads\Apps\Debloat-Windows-10\scripts\remove-onedrive.ps1:19 char:1
+ rm -r -Force "$env:localappdata\Microsoft\OneDrive"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (C:\Users\nyuszi...rosoft\OneDrive:DirectoryInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : RemoveFileSystemItemIOError,Microsoft.PowerShell.Commands.RemoveItemCommand
rm : Cannot find path 'C:\OneDriveTemp' because it does not exist.
At D:\Downloads\Apps\Debloat-Windows-10\scripts\remove-onedrive.ps1:22 char:1
+ rm -r -Force "C:\OneDriveTemp"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\OneDriveTemp:String) [Remove-Item], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand

Disable OneDrive via Group Policies
Remove Onedrive from explorer sidebar
Removing startmenu entry
Restarting explorer
W4RH4WK commented 8 years ago

Thanks for letting me know, I really should add more error handling, but most of the annoying stuff should have been removed already. I am wondering why there was no OneDrive process running, you didn't run this one on a (mainly) clean install, did you?

0xallie commented 8 years ago

I upgraded from Windows 8.1. I plan to do a reset at some point, but I'm too lazy.

W4RH4WK commented 8 years ago

I only test the scripts on a clean install (+ updates) Win10 64-Bit Pro. The scripts are mostly designed to work best effort, nevertheless I have to add more error handling.