The Computer Oracle

How to prevent a folder from being synced on OneDrive?

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game 3

--

Chapters
00:00 How To Prevent A Folder From Being Synced On Onedrive?
00:51 Accepted Answer Score 16
02:30 Answer 2 Score 3
03:17 Answer 3 Score 1
04:11 Answer 4 Score 1
04:44 Answer 5 Score 0
05:29 Thank you

--

Full question
https://superuser.com/questions/1662589/...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#windows10 #sync #onedrive #cloudstorage

#avk47



ACCEPTED ANSWER

Score 16


The article Exclude files and extensions from syncing to OneDrive – via Group Policies, by a Microsoft employee on May 5, 2021, describes this undocumented method, which is quite recent in Windows.

The OneDrive sync app must be restarted after this setting is enabled for it to take effect.

Step 1 : Add new policies to the Local GPO store

  • Position to folder %localappdata%\Microsoft\OneDrive\BuildNumber\adm\
  • Select the files OneDrive.adml and OneDrive.admx
  • Copy the files via Ctrl+C
  • Position to folder C:\Windows\PolicyDefinitions
  • Copy the files to the folder via Ctrl+V. Put the .adml (language) file into the en-us folder, not in the root.

Step 2 : Use the new policies

Now that the new group policies have been added:

  • Open Settings > Devices > Configuration Profiles
  • Open the new setting "Exclude specific kinds of files from being uploaded" found in Computer Configuration > Administrative Templates > OneDrive
  • Click on Enabled
  • Click on Show
  • Enter the files to exclude with wildcards
  • Click OK

Alternative - Use the registry

  • Start regedit
  • Navigate to HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\OneDrive\EnableODIgnoreListFromGPO
  • Create items named by a number( 1, 2 etc.) of type REG_SZ
  • Enter as value keywords with wildcards.

For example, enter *.pst to block all files with the .pst extension. Enter expense* to block files that have names beginning with "expense". And so on.




ANSWER 2

Score 3


I recently had to do this exact thing.

  1. Temporarily move your local files to a non-OneDrive location, allow OneDrive to sync the empty folder to the cloud

  2. Use Settings -> Backup -> Manage Backup to disable the top-level folder containing the now-empty directory

  3. Use Settings -> Account -> Choose folders to disable sync of the now-empty directory

  4. Reverse step 2, re-enable the top-level folder

  5. Reverse step 1, put the files back in the place they started.

After this process OneDrive will have a "Sync error" on the undesired files, they will be stored locally and never uploaded to the cloud.




ANSWER 3

Score 1


Currently, we can prevent image files being syncing to OneDrive, but we could not could not exclude specific folders to be synced to OneDrive.

Here is a similar thread "Registry exclude folder for OneDrive", on thread "Reassess the possibility to ignore or exclude selected OneDrive folders and files from the sync process." on UserVoice forum, the OneDrive PM Manager said they are are looking to expanding such feature to folders in the future.

I suggest you go to OneDrive folder, then copy the specific folder to other location that won't be synced to OneDrive, then navigate through OneDrive > Settings > Account > Choose folders agian, then unsynchronize this folder.

The folder would be still exist on your local computer, but it is no longer a mirror of the folder with a same name on OneDrive.




ANSWER 4

Score 1


I used the registry methods above, but I don't have OneDrive\EnableODIgnoreListFromGPO folder at all on the registry. It's still working nevertheless if you create the key yourself.

Hence what I did was create a new key by using New > Key and rename it to OneDrive, then create key again on OneDrive subfolder and rename it to EnableODIgnoreListFromGPO.

Now you can create items like what harrymc did above. No need to use gpedit, especially if you use Windows Home Edition like me.




ANSWER 5

Score 0


Actually, there is a way. You just have to reframe what you are trying to accomplish.

If this is what you want, this is how to do it.

I want OneDrive to stop syncing three large folders that will take hours to download, so that I can just sync one other folder that I want downloaded first, because I need to work with those files now.

In the taskbar, open OneDrive and click on Settings. Click 'Account' and then 'Choose folders'. Now uncheck those three big folders that you don't want downloaded yet. Hit 'OK'. This will stop their syncing from interfering with the syncing of your preferred folder.

Just remember to reverse this when you are done.