Exclude a folder or file from being synced by OneDrive
I have discovered that this option no longer works on the latest versions of OneDrive. The only exclusion functionality currently available is "exclusion of file extensions", which is rarely useful.
- Open directory
C:\Program Files\Microsoft OneDrive\[Version]\adm
or%localappdata%\Microsoft\OneDrive\[version]\adm\
- Copy the
OneDrive.admx
file toC:\Windows\PolicyDefinitions
- And
OneDrive.adml
file toC:\Windows\PolicyDefinitions\en-US
- And
- Start
gpedit.msc
(a Local Group Policy Editor) - Navigate to
LCP\Computer Configuration\Administrative Templates\OneDrive
- Find & open
Exclude specific kinds of files from being uploaded
- Enable
- Show
- Enter exclusion names with only asterisks available as wildcards
For example, enter*.pst
to block all files with the.pst
extension. Enterexpense*
to block files that have names beginning with "expense". And so on.
Files that are not synchronised, are going to look like this:
Credits to Christian Brinkhoff