Remove OneDrive

S-Soft 666 Reputation points
2023-04-13T07:01:29.38+00:00

Hello expert users. After installing Office 2021 OneDrive will also force install on the system. Untitled

Need to write a .bat batch file to uninstall OneDrive from batch command... Seems this OneDrive is not MSI so Get-WMIObject Win32_Product won't return it. This also won't work: Set x64="%ProgramFiles%\Microsoft OneDrive\OneDrive.exe" If Exist %x64% %x64% /Uninstall Manual uninstall from Control Panel is available, how to invoke it using .bat batch file? ( not PowerShell script )

Microsoft 365 and Office | Install, redeem, activate | For business | Windows
Microsoft 365 and Office | OneDrive | For business | Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Emily Hua-MSFT 27,796 Reputation points
    2023-04-14T05:48:58.5733333+00:00

    Hi @S-Soft

    Please make sure you have backed up the files in OneDrive.

    Then please copy the command winget uninstall Microsoft.OneDrive --accept-source-agreements in one .txt file. Then save this file as .bat file. For more, please refer to 'https://learn.microsoft.com/en-us/windows/package-manager/winget/uninstall'. Run this .bat file as an administrator to have a check.

    Any further issues, I suggest you post a new thread on Microsoft Tech Community --- OneDrive Developer, as we handle general issue of OneDrive syncing issue. The above suggestions are my personal test results. Thanks for your understanding.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.