At times, you may experience issues with OneDrive service. Upon attempting to access the files and folders inside the app, you may see the following error message – OneDrive cannot connect to Windows. The same issue exists if the Files on Demand feature is enabled for OneDrive. Here’s what you can do to fix the problem.
Why does this error occur
There are mainly two reasons why a user can find this issue on his/her computer. Whenever the OneDrive requires to display files as per the user’s demand, it is mandatory to have Windows Cloud Filter Driver or cldflt.sys running in the background. If it is not running as it should be, there is a chance of getting this error message. Secondly, even if the Windows Cloud Filter Driver is running, users can get this problem if it is not attached to the drive where the sync folder is placed. By default, this ‘drive’ is the C drive, but it can be different in your case.
OneDrive cannot connect to Windows, Files On-Demand requires a connection
The above error message is followed by a long description that reads as –
Files On-Demand requires a connection to Windows in order to show your files without taking up space on this device. OneDrive can keep trying to connect to Windows or you can choose to download all your files. You won’t be able to use online-only files until this is fixed.
If you see OneDrive cannot connect to Windows message, you should do the following:
- Preliminary steps
- Verify Files on Demand is enabled
- Verify if Windows Cloud Filter Driver is running or not
- Verify if Windows Cloud Filter Driver is attached to the drive
- Run Files On-Demand troubleshooter
- Execute the following command in an elevated command prompt:
1] Preliminary steps
- Make sure that you have a strong working internet connection
- Restart your PC and router, and check again
- If possible, change your internet connection from WiFi to Ethernet or vice versa and see
2] Verify Files on Demand is enabled
Verify that Files on Demand is enabled.
Right-click on the OneDrive icon in the notification area, select Settings and ensure that Save space and download files as you use them is enabled.
3] Verify if Windows Cloud Filter Driver is running or not
To verify whether the Windows Cloud Filter Driver is running on your computer or not, you can take the help of Command Prompt. A couple of commands can help you out, no matter whether you need to verify or enable it. To get started, run Command Prompt with administrator privilege, and type this command-
cd %systemroot%\system32\drivers
Hit the Enter button. After that, type the following command-
sc query cldflt
After pressing the Enter button, your Command Prompt should display a result like this-
The STATE should show as 4 RUNNING. If it is showing anything else, it is the time to enable it on your computer. For that, type the following command in the Command Prompt window-
sc config cldflt start=auto
Press the Enter button. If nothing wrong happens, you should see a success message saying [SC] ChangeServiceConfig SUCCESS.
Now, you should restart your computer and check if you can access the file or not. If not, the other guide might be helpful for you.
4] Verify if Windows Cloud Filter Driver is attached to the drive
If the cldflt.sys is not linked to the driver where the sync folder is located on your Windows computer, you can find this error message. It happens after an update or malware attack. Therefore, you need to verify this setting. The best thing is that you can do this job with the help of Command Prompt.
At first, you need to follow this guide to open an elevated Command Prompt window on your Windows computer. After opening it, paste the following command-
reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Notifications\Data" /v 41960B29A3BC0C75
and hit the Enter button. You should see a result like this-
REG_BINARY 0100000001000000
If it is showing anything else, you need to execute this command-
Fltmc attach cldflt c:
You should keep in mind that the “c” in the above command is the drive where the OneDrive folder is placed on your PC.
Now restart your computer and use the Files On-Demand as usual.
Related: OneDrive cannot connect to Server error
5] Run Files On-Demand troubleshooter
Run the Files On-Demand troubleshooter and see if it helps.
Related read: Fix OneDrive sync issues & problems on Windows.
6] Execute the following command in an elevated command prompt:
reg add HKLM\System\CurrentControlSet\Services\Cldflt\instances /f /v DefaultInstance /t REG_SZ /d "CldFlt"
Once done, restart your computer and check.
You will now be able to use OneDrive Files On-Demand.