39

I have recently changed the location of my Documents folder (originally located in C:\Users\TermoZour\Documents) to C:\Users\TermoZour\OneDrive\Documents so I could sync the documents folder between 2 PCs.

Now I want to remove this "link", but I can't. Whenever I try to "Restore Default Location" it indeed sees the default location as expected, but then it asks me if I want to move all the files from the old directory (OneDrive) to the new one (default Documents directory), so I click yes. After this, it tells me that "it can't remove the folder because there is a folder in the same location that can't be redirected. Access denied."

I tried to move all the files from OneDrive into a separate folder and do the process again, but it gave me the same error.

I tried to choose another new location instead of the default one, but it gave me the same error.

TermoZour
  • 677
  • 4
  • 11
  • 23
  • 2
    Check [this](https://support.microsoft.com/en-in/help/2936105/operation-to-change-a-personal-folder-location-fails-in-windows) workaround. – BDRSuite May 03 '17 at 16:23

5 Answers5

41

According to the Microsoft Support article linked by vembutech, you can use the following workaround.


Important

Follow the steps in this section carefully. Serious problems might occur if you modify the registry incorrectly. Before you modify it, back up the registry for restoration in case problems occur.

To work around this issue, follow these steps:

  1. Right-click the Windows logo at the lower-left corner of the screen, and then click Run.

  2. Type regedit.exe and press Enter. If User Account Control window pops up, click Yes.

  3. In Registry Editor, browse to the following path: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

  4. Refer to the following table to find the registry key for the folder that encounters this issue, and change it to the default value.

+-----------+----------------------------------------+-------------------------+
|  Folder   |              Registry key              |      Default value      |
+-----------+----------------------------------------+-------------------------+
| Downloads | {374DE290-123F-4565-9164-39C4925E467B} | %USERPROFILE%\Downloads |
| Desktop   | Desktop                                | %USERPROFILE%\Desktop   |
| Favorites | Favorites                              | %USERPROFILE%\Favorites |
| Music     | My Music                               | %USERPROFILE%\Music     |
| Pictures  | My Pictures                            | %USERPROFILE%\Pictures  |
| Videos    | My Video                               | %USERPROFILE%\Videos    |
| Documents | Personal                               | %USERPROFILE%\Documents |
+-----------+----------------------------------------+-------------------------+
  1. Restart the Explorer.exe process to make the changes take effect. To do this, you can use either of the following steps:
  • Restart the process in Task Manager.
  • Sign out, and then sign in.
  • Restart the computer.
Stevoisiak
  • 13,555
  • 39
  • 101
  • 154
  • 2
    In my case, the Documents and Pictures folders had long alphanumeric keys like the Downloads folder in addition to the keys listed here (Personal and My Pictures). I had to change both for it to work. – jpyams Mar 17 '19 at 16:07
  • 2
    I was just beginning to like Microsoft again, then they pull a number like this that requires registry edits to make a simple change – jpyams Mar 17 '19 at 16:08
  • 2
    Ted's answer is more up to date. Anyone else having the issue should check that answer before editing the registry. – relatively_random Mar 22 '19 at 09:58
  • 1
    This saved my day. When editing the registry there's also the value {F42EE2D3-909F-4907-8871-4C22FC0BF756} that is the link for 'This PC -> Documents' in the left bar of the explorer.exe – Phate01 Jul 04 '19 at 14:26
  • I had OneDrive uninstalled, like many others, then I could safely delete all alphanumeric keys in this registry folder **if they were a 'duplicate'** of a normal textual variant. For example one key identified by 'Personal' pointing to `%USERPROFILE%\Documents` and one alphanumerical pointing to `%USERPROFILE%\Onedrive\Documents`, the latter can be removed. This way I got rid of several 'onedrive' variants. Maybe this caused the troubles to begin with? – Piemol Sep 29 '21 at 19:45
  • No need to edit the registry. I have done the steps described in Crismogram's and Kevin's answers, and Windows restored folders to default locations itself. If you logged out from OneDrive, then simply log in again to perform these steps and then log out. – iwis Oct 15 '21 at 18:09
26

You can now go to One Drive's Settings and click on Backup> Manage Backup and Stop backing up the Desktop, Pictures and Documents.

enter image description here

David d C e Freitas
  • 4,511
  • 4
  • 27
  • 35
Crismogram
  • 361
  • 3
  • 4
  • 1
    The _Backup_ is what came into place of the _More > Settings > Auto Save > Update folders_ menu. I used this to stop backing-up my documents folder on OneDrive. – Christophe Lambrechts Apr 23 '20 at 08:07
  • 2
    This is the right answer. If you try to directly unsync the folders, it doesn't let you saying that the folder is "important" or what not. After stopping the backup, I was able to deselect them. – giraffehere Sep 15 '20 at 01:36
  • 1
    One step missing: you have to manually cut and paste the files from OneDrive back to the Documents folder. – Endy Tjahjono Apr 18 '21 at 04:08
  • 2
    You need to stop the backup in order to regain control of where Documents points to, the Backup feature is actually hijacking the local computer data, moving it to OneDrive and unfortunately applications (like games) wrongly use folders in Documents, so settings and things you do on one computer are synced by OneDrive to others. – Rob11311 Jun 13 '21 at 18:46
4

No need for editing the registry. It takes about a minute to reverse the OneDrive "protect your important folders" steps.

Select the OneDrive (white or blue cloud) icon in the Windows notification area, and then in the activity center, select More > Settings > Auto Save > Update folders. Now deselect the folder(s) you want to make local and then choose to stop protection (no more cloud cloning/syncing).

https://support.office.com/en-us/article/sync-your-documents-pictures-and-desktop-folders-with-onedrive-d61a7930-a6fb-4b95-b28a-6552e77c3057

Every folder you deselect will be created for you on your local disk in the default location (and more*, read on). The process will provide shortcuts in these folders and their subfolders* called "Where are my files" which is a link to the corresponding OneDrive cloud location. *It also means your new folders may have a bunch of empty subfolders (save for the aforementioned shortcut). Your new folder's structure is a fileless clone of the corresponding previous folder's structure which still exists on OneDrive. Each (sub)folder only contains the cloud shortcut and any subfolders, but nothing more. In the newly created local folder, prune away any subfolders you don't want and delete any of the shortcuts you have no need for.

Stevoisiak
  • 13,555
  • 39
  • 101
  • 154
  • 1
    This may work now, at the time of writing this question, there were no options in OneDrive for doing that – TermoZour Jan 27 '19 at 11:24
  • @TermoZour however if this is the correct way of doing it stand today than why shouldn't a more up-to-date answer be added to an old question? – derHugo Mar 25 '19 at 06:20
  • 2
    In my case I had uninstalled OneDrive right after installing windows10 on my PC .. so in order to do this I either could fuck with the registry or (what I did) reinstall OneDrive and login so I finally could reach the settings and remove all folders from the sync. Than I could finally move them all to my data harddrive because only windows itself allready eats 50GB ... wtf Microsoft? ^^ – derHugo Mar 25 '19 at 06:38
  • @derHugo you're right. A more up to date answer should be posted, I just pointed out that the answer was not working at the time of writing the question. – TermoZour Mar 25 '19 at 10:04
  • For people who have uninstalled OneDrive, this is not an option - unless they choose to reinstall one drive and go through this process. Instead, what I had to do was delete the registry entries associated with one drive. Then, follow the earlier instructions. At that point, you can just right click the library folder > go to location tab > selection the new location > accept -- it no longer switches back. No reinstalling OneDrive required. – HoneyBuddha Jan 20 '20 at 13:51
  • *Point being, this option is not necessarily the "correct way" for anyone who has uninstalled OneDrive - since, it requires an unnecessary reinstall of OneDrive, when the problem can be addressed directly.* – HoneyBuddha Jan 20 '20 at 13:58
  • That worked for me, thank you for not having to mess up with registry ! – Ivan Yurchenko Jun 11 '20 at 14:50
  • @HoneyBuddha Can you elaborate a little bit please? When you say "delete the registry entries associated with one drive" what exactly do you mean? With OneDrive totally uninstalled, nothing should be associated with it, and in my registry everything already shows %USERPROFILE%\. Are you saying to delete those entries for Personal (Documents), My Music, My Video, My Pictures, etc. and then re-create them? – Drew Angell Jun 18 '20 at 02:53
1

I just upgraded a computer from Windows 7 to Windows 10 and ran into the same issue. You do not need to modify the Registry when you get the "...can't be redirected. Access denied." error.

Instead of right-clicking on a folder under "This PC" in an Explorer window and trying to change the location through Properties > Location > Restore Default button, I was able to change the location of my Documents and Pictures folders from OneDrive to local storage by doing the following:

  1. Right-click the OneDrive cloud icon located towards the bottom right of the screen in the Taskbar.
  2. Click the Help & Settings button.
  3. Select Settings from the menu that appears.
  4. Click the Account tab.
  5. Click the Choose folders button.
  6. Uncheck the folders you do not want to use as OneDrive storage. (In my case I had to expand the Documents and Pictures folders and uncheck the Files in "Documents" and Files in "Pictures" boxes before the parent folders were no longer checked.)

After completing these steps my locations under "This PC" reverted to my local Documents and Pictures folders instead of the OneDrive folders.

Kevin
  • 11
  • 1
0

The link from Microsoft Support which can be found here posted by @vembutech23 fixed the issue.

Before I did what the link said, I paused OneDrive syncing just in case.

After I restarted explorer.exe everything went back to normal and my Documents folder got unlinked from OneDrive.

TermoZour
  • 677
  • 4
  • 11
  • 23
  • 1
    Answers should usually [include relevant information from external sites](https://meta.stackexchange.com/questions/225370/your-answer-is-in-another-castle-when-is-an-answer-not-an-answer). That way the answer can still be relevant if the linked page ever becomes inaccessible. – Stevoisiak May 05 '17 at 18:39
  • Okay, thanks for telling me. I'll do that next time – TermoZour May 06 '17 at 05:02