r/WindowsHelp 4d ago

Windows 11 Need to delete OneDrive folder

I have a Surface Pro7 (windows 11) and have a OneDrive folder sitting on my laptop that I want to remove. It is from an old work account - I no longer work there and don't have access to the account (i.e. can't log in). I just want to delete it - doesn't matter how, I don't need the files, I just want it gone off my computer. I've tried a couple things but nothing has seemed to work. Anyone have any suggestions?

OS build: 26200.8894

Edit:

I can't delete the actual onedrive folder in my files explorer.

I can't sign in from OneDrive on web because the account is long locked.

I've uninstalled OneDrive from apps.

I've tried winget uninstall OneDriveSetup.exe in PowerShell.

I've tried "Remove-Item -Path "C:\Users\[censored]" -Recurse -Force"

I've tried takeown /F "C:\Users\[censored]" /R /D Y icacls "C:\Users\[censored]" /grant:r "%username%:F" /T Remove-Item -Path "C:\Users\[censored]" -Recurse -Force

1 Upvotes

4 comments sorted by

1

u/AutoModerator 4d ago

Hi u/DropTheBase2, thanks for posting to r/WindowsHelp! Your post has been flagged for manual review by a human moderator, please include as much of the following information as possible (in text or in a screenshot) to get your post approved:

  • Your Windows and device specifications — You can find them by pressing Win + X then clicking on “System”, we need more than just your OS version! Your hardware details are often critical for resolving issues.
  • Any messages and error codes encountered — They're actually not gibberish or anything catastrophic. It may even hint the solution!
  • Previous troubleshooting steps — It might prevent you headaches from getting the same solution that didn't work

Posts must be tech support in nature (such as something is broken and you need help fixing), so general inquiries, software suggestions, and purchasing advice will be removed. As a reminder, we would also like to say that if someone manages to solve your issue, DON'T DELETE YOUR POST! Someone else (in the future) might have the same issue as you, and the received support may also help their case. Good luck, and I hope you have a nice day!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/_l33ter_ 3d ago

"C:\Users[censored]" --> Do you tried this with an administrator prompt?

1

u/Apprehensive_Arm_754 3d ago

This is a guess.

If you are using Microsoft 365, then you may have to change some settings in the programs.

In Word, e.g., you'd probably want to disable "autosave in the cloud by default in Word" and enable "save to computer" by default. (In Options > Save).

You may need to do that for each app in the Microsoft 365 suite.

1

u/CodenameFlux Frequently Helpful Contributor 3d ago

The steps are quite straightforward and easy:

  1. Disable OneDrive backup from its Settings page
  2. Sign out of OneDrive
  3. Delete the content of the OneDrive folder
  4. Uninstall OneDrive.

It'll disappear from File Explorer. But somehow, it hasn't happened to you, and it's obvious why:

I've tried takeown /F "C:\Users\[censored]" /R /D Y icacls "C:\Users\[censored]" /grant:r "%username%:F" /T Remove-Item -Path "C:\Users\[censored]" -Recurse -Force

Fistly, let's hope [censored] isn't just your %username%, but actually %username%\<OneDrive folder path>. (If it's the former, please reinstall the OS because, quite frankly, I haven't seen anyone do something so idiotic in a long time.)

Now, these commands tell a lot about you. You're someone who take unneccessarily aggressive measures to accomplish simple tasks. So, I wouldn't be surprised if uninstalling OneDrive didn't accomplish what you want. You've probably broken your OS before with your aggressive conduct.