Here's how to permanently wipe OneDrive folders from your PC if they keep recreating themselves

OneDrive crossed out
(Image credit: Microsoft)

There aren't many things in life I regret more than letting Windows install OneDrive. Honestly, I don't remember if it even gave me an option, but I assume that at some point when updating Windows 10 Microsoft snuck it in and I didn't find the buried checkbox I needed to nip it right in the bud. So I let OneDrive in, it took over my Documents and Photos folders, promptly filled up its cloud storage, and started hounding me to buy more storage space. "Immediately making your product hateable" doesn't strike me as the best strategy, but maybe my lack of vision in this area is why I don't run a trillion-dollar company. Anyway: I got fed up, uninstalled OneDrive, and assumed that would be the end of it.

It was not the end of it.

Steve Ballmer's ghost has been haunting me through an undead OneDrive folder ever since. Even though I told OneDrive to stop syncing all my folders and then uninstalled it, somewhere in the bowels of Windows a remnant remained. When I installed new programs, they'd often default to storing their config files in C:\Users\[myname]\OneDrive\Documents. Even though I had deleted that folder. They just kept recreating it! 

I can't say I keep my PC perfectly organized—my Downloads folder is a mess of years worth of animated gifs and installers—but I at least like to know that when I open up my Documents folder, it's all of my documents, not Most Of My Documents Except The Ones Created By Programs Installed In The Last Month. The general advice here is to set your Documents folder location in File Explorer, but I'd done that, and it didn't stop the OneDrive folder from being resurrected with every new install.

I scoured the internet looking for a solution for this problem, and most Microsoft help pages and forum discussions I ended up on were dead ends. Finally I found it: the registry entry I needed to modify to banish OneDrive from my PC once and for all. Hopefully this offers someone else out there the same relief it offered me.

How to stop Windows programs from defaulting to a nonexistent OneDrive folder

We're going to do some very light registry editing to fix this annoying problem. Don't worry, it isn't scary: these are clearly marked, easily understandable registry entries we're changing, not arcane blobs of numbers.

1. Press the Windows key and type "Regedit" to search for the Registry Editor. Click it to open it up.

2. Copy/paste this string into the address bar at the top and hit enter: 

Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

Once there, you should see a fairly short list of default folder locations. If your system is like mine, most of these entries are in plain English, e.g. "My Music" and "Programs," while a few are longer bits of gibberish in {}. What you want to look at is the Data column, which indicates where Windows is by default directing new programs that want to set up shop in your Documents/Photos/etc. folders. Here I found my culprits. 

OneDrive registry edits

(Image credit: Future)

3. The fix is simple. Right-click on each entry in the Name column and hit Modify. Delete "OneDrive\" from the address string and hit OK. Do this for any and all entries where OneDrive shows up. 

OneDrive registry edits

(Image credit: Future)

And that's it: you're freed from the OneDrive curse. Breathe deep of that fresh, clean air and enjoy knowing that new programs will put their files just where you want them. 

Wes Fenlon
Senior Editor

Wes has been covering games and hardware for more than 10 years, first at tech sites like The Wirecutter and Tested before joining the PC Gamer team in 2014. Wes plays a little bit of everything, but he'll always jump at the chance to cover emulation and Japanese games.

When he's not obsessively optimizing and re-optimizing a tangle of conveyor belts in Satisfactory (it's really becoming a problem), he's probably playing a 20-year-old Final Fantasy or some opaque ASCII roguelike. With a focus on writing and editing features, he seeks out personal stories and in-depth histories from the corners of PC gaming and its niche communities. 50% pizza by volume (deep dish, to be specific).