[Solved] How to fix “OneDrive Cannot Connect to Windows” error on Windows 10 when accessing Files On-Demand

The “OneDrive Cannot Connect to Windows” error message shown when the user trying to access files in the OneDrive folder if the user has previously enabled Files On-Demand in OneDrive settings.

[Solved] How to Fix "OneDrive Cannot Connect to Windows" Error
[Solved] How to Fix “OneDrive Cannot Connect to Windows” Error
The detail error message as below:

OneDrive cannot connect to Windows. 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.

Follow the below steps to resolve this error.

Content Summary

Solution 1: Update Windows to the latest version
Solution 2: Unlink Onedrive account
Solution 3: Do TCP/IP Reset
Solution 4: Modify Internet Properties
Solution 5: Enable the cldflt.sys driver
Solution 6: Disable or uninstall 3rd party antivirus and firewall software
Solution 7: Reset OneDrive App
Solution 8: Reinstall OneDrive App

Solution 1: Update Windows to the latest version

Most of the older build of Windows 10 affected by a bug that interrupts communications between the cloud server and the local synchronization feature of OneDrive. Apply the latest available Windows update to fix the ‘OneDrive Cannot Connect to Windows‘ error.

Step 1: Press Windows key + R to open the Run dialog box.

Step 2: Type ms-settings:windowsupdate and press Enter to open the Windows Update tab of the Settings app.

* If you are updating Windows 7 or Windows 8.1 to the latest version then use wuapp command instead.

Step 3: Click on Check for updates button then follow the on-screen prompts to complete the installation of Windows update.

Step 4: Restart the computer after the update completed.

This error can trigger in those instances where the Files On-Demand feature was activated but the synchronization location set to a USB drive or external HDD / SSD which is not fully supported by OneDrive. You can fix the issue by unlinking the computer from the OneDrive account then re-add account again in order to force the path to refresh.

If you have been using the OneDrive sync client without Files On-Demand and then enable Files On-Demand, some users have reported that they received an error “OneDrive cannot connect to Windows” preventing them from enabling Files On-Demand:

This is because the sync location being used is not the local hard drive and instead is using either an external USB or hard drive which cannot be used for the OneDrive sync location. You will need to go to OneDrive sync client settings tab (from the sys tray), on the Account tab unlink the PC from the account and then add the account again but this time select the local hard drive as the sync location.

Step 1: Click on the OneDrive icon in the taskbar icon (systray) and select on More > Settings.

Step 2: Click the Account tab then click on Unlink this PC link to remove the current account.

Step 3: Click on Unlink Account once again to confirm the operation.

Step 4: Restart the computer to clear any temp data.

Step 5: After computer bootup, open OneDrive again and enter your credentials to sync your account with the PC once again.

Step 6: Ensure that local drive is selected if prompt to select which location to use for OneDrive.

Source: Connecticut State Colleges & Universities IT Support Center > Office 365 – OneDrive for Business FAQ

Solution 3: Do TCP/IP Reset

Common network inconsistencies such as bad Gateway or dynamic IP changing too often will trigger this error message as well.

Step 1: Press Windows key + R to open the Run dialog box.

Step 2: Type cmd and press Ctrl + Shift + Enter to open Command Prompt window with admin access. If the User Account Control (UAC) window prompt, click Yes to grant administrative privileges to the CMD terminal.

Step 3: Type the following commands and press Enter after each one to do a complete TCP/IP reset:

netsh int ip reset
netsh winsock reset
ipconfig /release
ipconfig /renew
ipconfig /flushdns

Step 4: Restart the computer.

Solution 4: Modify Internet Properties

Step 1: Press Windows keys Win + R to open the Run dialog box.

Step 2: Type inetcpl.cpl in the Run box and press Enter key to launch the Internet Properties.

Step 3: Choose the Advanced tab. Make sure Use TLS 1.0, Use TLS 1.1, and Use TLS 1.2 options are checked, then click on the Apply button.

Step 4: Go to the Connections tab. Click the LAN settings button below. Check the Automatically detect settings option and uncheck the Use a Proxy Server for your LAN option then click the OK.

Step 5: Click the Apply and the OK button to exit.

Step 6: Restart the computer.

Solution 5: Enable the cldflt.sys driver

When the Files on Demand feature in OneDrive is enabled but the cldflt.sys driver is not enabled, this error occurs. Follow the below guide to force cldflt.sys driver to run manually using elevated command prompt.

Step 1: Press Windows key + R to open the Run dialog box.

Step 2: Type cmd and press Ctrl + Shift + Enter to open Command Prompt window with admin access. If the User Account Control (UAC) window prompt, click Yes to grant administrative privileges to the CMD terminal.

Command Prompt Run as Administrator
Command Prompt Run as Administrator

Step 3: Type the following commands and press Enter to navigate to the location where the cldflt.sys driver present: cd %systemroot%\system32\drivers

Step 4: Type the following command and press Enter to inquire about the cldflt.sys drive: sc query cldflt

Navigate to cldflt and query.
Navigate to cldflt and query.

Step 5: Under Service_Name: cldflt, look at the STATE. If the state is not 4, change the state of cldflt.sys to automatically run.

Check cldflt STATE
Check cldflt STATE

Step 6: Type the following command to enable the service directly from this terminal window: sc config cldflt start=auto

Change the state of cldflt.sys to automatically run
Change the state of cldflt.sys to automatically run

Step 7: Restart the computer.

Source: Microsoft Office Support > “OneDrive cannot connect to Windows” error when accessing files in OneDrive

Solution 6: Disable or Uninstall 3rd party antivirus and firewall software

Start by disabling real-time protection and see if the syncing issue stops occurring. In case the issue remains even after disabled the active protection, you might need to consider temporarily uninstalling the 3rd party suite to ensure that there is no antivirus interference.

We fixed an issue resulting in Insiders with certain third party antiviruses and OneDrive Files on Demand enabled seeing an error in recent builds citing “OneDrive cannot connect to Windows”.

Source: Microsoft Windows Blog > Announcing Windows 10 Insider Preview Build 17046 for PC

Solution 7: Reset OneDrive App

Step 1: Press Windows key + R to open the Run dialog box.

Step 2: Type %localappdata%\Microsoft\OneDrive\onedrive.exe /reset and press Enter.

Reset OneDrive Application
Reset OneDrive Application

* “%localappdata%” refer to “%USERPROFILE%\AppData\Local”. For example c:\users\alex\AppData\Local

Step 3: Wait for the Microsoft OneDrive icon appearing in the notification area. If it does not appear, paste the command to the Run: %localappdata%\Microsoft\OneDrive\onedrive.exe.

Solution 8: Reinstall OneDrive App

Step 1: Press Windows key + R to open the Run dialog box.

Step 2: Type cmd and press Ctrl + Shift + Enter to open Command Prompt window with admin access. If the User Account Control (UAC) window prompt, click Yes to grant administrative privileges to the CMD terminal.

Step 3: Type appwiz.cpl and press Enter to open Add/Remove Programs.

Step 4: Locate the Microsoft OneDrive app from the list and right-click it then choose Uninstall.

Step 5: Restart the computer.

Step 6: Visit the OneDrive Download page and select the need to reinstall/download hyperlink to commence the reinstallation process.

Step 7: Restart the computer after OneDrive installation completed.