Skip to Content

How to Fix OneDrive Cannot Connect to Windows error 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

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.

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.

  1. Press Windows key + R to open the Run box.
  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.
  3. Click on Check for updates button then follow the on-screen prompts to complete the installation of Windows update.
  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 the account again 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.

  1. Click on the OneDrive icon in the taskbar icon (systray) and select on More > Settings.
  2. Click the Account tab then click on Unlink this PC link to remove the current account.
  3. Click on Unlink Account once again to confirm the operation.
  4. Restart the computer to clear any temp data.
  5. After computer bootup, open OneDrive again and enter your credentials to sync your account with the PC once again.
  6. Ensure that local drive is selected if prompt to select which location to use for OneDrive.

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.

  1. Press Windows key + R to open the Run box.
  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.
  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
  4. Restart the computer.

Solution 4: Modify Internet Properties

  1. Press Windows keys Win + R to open the Run box.
  2. Type inetcpl.cpl in the Run box and press Enter key to launch the Internet Properties.
  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.
  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.
  5. Click the Apply and then OK button to exit.
  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.

  1. Press Windows key + R to open the Run box.
  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
  3. Type the following commands and press Enter to navigate to the location where the cldflt.sys driver present: cd %systemroot%\system32\drivers
  4. Type the following command and press Enter to inquire about the cldflt.sys drive: sc query cldfltNavigate to cldflt and query.
  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
  6. Type the following command to enable the service directly from this terminal window: sc config cldflt start=autoChange the state of cldflt.sys to automatically run
  7. Restart the computer.

Solution 6: Attach Sync Folder

  1. Press Windows key + R to open the Run box.
  2. Type cmd and press Ctrl + Shift + Enter to open Command Prompt window with admin access. Click Yes to grant administrative privileges to the CMD terminal if the User Account Control (UAC) window prompted.
  3. Type the following commands and press Enter: reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Notifications\Data" /v 41960B29A3BC0C75
  4. If the output is not showing REG_BINARY 0100000001000000, then proceed to the next step. If the output is empty, navigate to the location in the registry and create the key.
  5. Type the following commands and press Enter: Fltmc attach cldflt c:
    c: refer to the drive where the OneDrive folder is located.
  6. Restart the PC.

Solution 7: 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”.

Solution 8: Reset OneDrive App

  1. Press Windows key + R to open the Run box.
  2. Type %localappdata%\Microsoft\OneDrive\onedrive.exe /reset and press Enter.
    “%localappdata%” refer to “%USERPROFILE%\AppData\Local”. For example c:\users\alex\AppData\LocalReset OneDrive Application
  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 9: Reinstall OneDrive App

  1. Press Windows key + R to open the Run box.
  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.
  3. Type appwiz.cpl and press Enter to open Add/Remove Programs.
  4. Locate the Microsoft OneDrive app from the list and right-click it then choose Uninstall.
  5. Restart the computer.
  6. Visit the OneDrive Download page and select the need to reinstall/download hyperlink to commence the reinstallation process.
  7. Restart the computer after OneDrive installation completed.