Fix "Free Up Space" greyed out for Files On-Demand
With the "File On-Demand" settings activated, the option "Free up space" from the Windows Explorer contextual menu is grayed out on parent directories.
However, it is available for individual files.
This happens if the "Free up space" has been already clicked once on a given directory. After adding files (locally available), the option is grayed out on this directory, although some children files are available locally (thus space not "freed up").
Steps to reproduce the error:
1/ Create a directory, e.g. OneDrive/test
2/ In this directory, create a file, e.g. OneDrive/test/file1.txt
3/ Wait for the OneDrive sync to end.
4/ The "file1.txt" will be locally available
5/ Right click on the "test" parent directory, and select "Free up space"
6/ Wait for the OneDrive sync to end.
7/ The "file1.txt" will switch status from "local" to "online"
8/ Add a new file "file2.txt" in the "test" directory: OneDrive/test/file2.txt
9/ Wait for the OneDrive sync to end.
10/ The "file1.txt" will be locally available
11/ Right click on the "test" parent directory, the option "Free up space" is now grayed out
Windows 10 x64, Version 10.0.17134 Build 17134
OneDrive for Windows, Version 2018 (Build 18.222.1104.0007)
Cameron Oliver commented
I am having the same issue, and I can't do the work-around keeping on my device first because it is a shared space for my whole company and is far too large to fit on my local disc. I was looking into making a script to do it for each file individually, but that doesn't look possible.
I didn't even have the trigger of the bug mentioned in the OP, it is just happening. Since I am also experiencing an issue where there are random files I have never opened being kept on my device, it is very annoying as I am unable to get my disc space back
Rob Nicholson commented
Similar problem here with confused flag settings. Another way to repeat it. Assume "E:\OneDrive - Revolution" is your OneDrive folder. Run robocopy "E:\OneDrive - Revolution" "E:\Backup" /mir /ndl which forces all the files to download. The "Clear space" option at the root is grayed out. Clicking keep and then clear space does work. You can also use attrib with the unpin settings
I found that if "Clear Space" is greyed out, I can have it re-appear by first clicking "Always Keep on this device". Once that finishes, it is possible to click "Clear Space".
Ryan T Ralston commented
I had a similar problem. When moving a folder of files from a synced folder (with local copy) to a cloud based on-demand folder, I would get the greyed out Free Up Space option in the on-demand folder even though the local version was still there.
As a workaround, I did find that if I right clicked the recently relocated folder and selected "Always keep on this device" THEN right clicked, I would get the option to "Free up space."
It isn't perfect, especially if you have a mix of both local and cloud files in the transferred folder (it needs to download all the on-demand files when you select 'always keep on this device,' but nonetheless it does seem to get around the greyed out option.
Pedro Lucas commented
I arrived here because I have the same problem.
I had a 500GB huge folder on Onedrive locally full of small files, and decided to "free up space", but the menu item is "greyed out".
I can "Free up space" on files, but I have 84K files...and it's not practical to search for 84K "*" , try to select all and Free up space. Actually it doesn't work, it's too many files to show on a folder list.
If i create a test folder the "Free up space" is enabled and works ok. But on my huge size folder, the one I "need" to get space from...it's greyed out.