Home

How to fix OneDrive error code 0x8004def7?

Alton Alexander
By Alton AlexanderUpdated on June 4th, 2022

OneDrive error code 0x8004def7 can occur when OneDrive is not able to connect to the Microsoft servers. This can be caused by a number of things, such as an unstable internet connection, incorrect proxy settings, or a firewall that is blocking OneDrive. If you are seeing this error, we recommend checking your internet connection and proxy settings first. If those are not the issue, then try temporarily disabling your firewall to see if that allows OneDrive to connect.

1. Restart your computer and try again

  1. If you are using a Windows 10 computer, open the Start menu and search for "Command Prompt." When Command Prompt appears, right-click on it and select "Run as administrator."
  2. In Command Prompt, type "shutdown -r now" and press Enter.
  3. After your computer shuts down, remove the battery and plug in your power cord. Wait 10-15 minutes for it to reboot.
  4. When your computer reboots, log in and open onedrive. Try to create or open a file. If the problem is still present, follow the steps below.
  5. If the problem is not present after following the steps below, your computer may have a hardware issue and you will need to take it to a repair shop.

2. Check your internet connection and try again

  1. Open the internet browser and type onedrive.com in the address bar.
  2. If the website is not loading, click on the three lines in the top left corner of the webpage and select “Show Error Details”.
  3. On the Error Details page, look for an error code.
  4. If you see an error code, please read the instructions below to try to fix it.
  5. If you do not see an error code, please try to connect to onedrive.com again. If you are still having problems, please contact onedrive.com customer service.

3. Make sure you're signed in with the correct Microsoft account

First, try signing in with your Microsoft account if it's not already signed in. If signing in with your Microsoft account doesn't work, then try signing in with a different account. If signing in with a different account doesn't work, then try signing in with your Microsoft account and then signing out of your onedrive account. If signing out of your onedrive account and then signing in with your Microsoft account still doesn't work, then try resetting your onedrive account.

4. Try resetting OneDrive

  1. Open OneDrive on your computer.
  2. Click the three lines in the top left corner of the window.
  3. Click Settings.
  4. Click the three lines in the top right corner of the window.
  5. Under "OneDrive settings," click Reset.
  6. Click Reset again.
  7. If prompted to provide a Microsoft account password, type the password and then click OK.
  8. OneDrive will close and reopen. If the problem still exists, repeat the steps.

5. Uninstall and reinstall OneDrive

  1. Open the Start menu and type "cmd".
  2. When the cmd window opens, type the following command and hit enter: Uninstall-WindowsFeature -Name OneDrive -IncludeAllSubFeature
  3. When the uninstall window appears, click on the Remove button.
  4. When the uninstall window closes, type the following command and hit enter: Install-WindowsFeature -Name OneDrive -IncludeAllSubFeature
  5. When the installation window appears, click on the Next button.
  6. On the Select Features page, click on the check box next to the OneDrive feature and click on the Next button.
  7. On the Confirm Feature Installation page, verify that the OneDrive feature has been installed and click on the Finish button.
  8. When the installation has finished, open the Start menu and type "cmd".
  9. When the cmd window opens, type the following command and hit enter: OneDriveSetup.exe
  10. On the OneDrive Setup window, click on the Next button.
  11. On the Select Destination Location page, choose the location where the OneDrive files will be stored and click on the Next button.
  12. On the Select Files To Sync page, select the files and folders that you want to sync to your computer and click on the Next button.
  13. On the Confirm Sync Location and Files Selected page, verify that the files have been synced and click on the Finish button.
  14. When the installation has finished, close the OneDrive Setup window and open the Start menu and type "cmd".
  15. When the cmd window opens, type the following command and hit enter: OneDrive.exe
  16. On the OneDrive window, click on the Sync button.
  17. On the OneDrive Sync window, click on the Start Sync button.
  18. When the sync has finished, click on the Close button.

6. Contact Microsoft support

The Microsoft support team will need to be contacted in order to resolve the error code. The support team will need to be contacted via telephone or online.