I tried removing OneDrive from Command Prompt, and afterward Windows became mostly unusable. My desktop and taskbar shortcuts disappeared, newly created folders cannot be renamed, and I receive error 0x80004005. It seems OneDrive may have been handling locations such as Desktop, Documents, or Pictures. Is there a way to restore the PC to its previous state, then stop OneDrive from managing those folders safely?
4 Answers
Try opening Task Manager with Ctrl+Shift+Esc, choose File > Run new task, enter rstrui.exe, and run it as administrator. If System Restore is enabled, select a restore point from before the OneDrive commands. This is preferable to resetting Windows because it may restore the folder paths and registry settings without removing your personal files.
The likely problem is that OneDrive was managing the Desktop, Documents, or Pictures folders when it was removed. Windows may still be pointing those locations at a missing OneDrive path. If System Restore does not work, use Windows Reset with the option to keep personal files, after backing up anything you can access.
Once Windows is working again, open OneDrive settings and unlink the PC before uninstalling it. In the backup or sync settings, turn off Desktop, Documents, and Pictures one at a time, and make sure local folders are created and contain your files. Only then remove OneDrive through Installed apps rather than deleting it with Command Prompt.
For a completely fresh installation that does not automatically set up OneDrive, install Windows from a bootable USB and create a local account during setup. Keep the computer offline during the initial setup if necessary, then unlink and uninstall OneDrive normally after Windows starts.

I ran System Restore and the computer restarted, but Windows still showed the same broken desktop and folder behavior. I’m trying to find another way to return everything to its previous state.