Fix OneDrive issue

How to Fix OneDrive Error 0x8004def4

Symptoms
  • Error code 0x8004def4 appears.
  • OneDrive asks you to restart OneDrive and if the problem presist, to restart Windows.

Start with a reset. If the problem persists, perform a clean reinstall.

Method 1 - Reset OneDrive

Open Run (Win + R) or Command Prompt and run:

%localappdata%\Microsoft\OneDrive\OneDrive.exe /reset
Note
If resetting does not resolve the issue, continue with the clean reinstall below.

Method 2 - Clean Reinstall OneDrive

Step 1 - Uninstall OneDrive

  1. Open Command Prompt as Administrator.

  2. Uninstall OneDrive:

    %SystemRoot%\System32\OneDriveSetup.exe /uninstall
  3. Verify that OneDrive has been removed:

    dir "%localappdata%\Microsoft\OneDrive"

    Expected result: OneDrive.exe should no longer exist.

  4. If OneDrive.exe is gone but some files remain, terminate any remaining OneDrive processes:

    taskkill /F /IM OneDrive.exe
    taskkill /F /IM OneDrive.App.exe
    taskkill /F /IM FileCoAuth.exe

    Rename the remaining folder:

    ren "%localappdata%\Microsoft\OneDrive" OneDrive.old
  5. Open PowerShell as Administrator and remove the AppX package:

    Get-AppxPackage Microsoft.OneDriveSync | Remove-AppxPackage
  6. Finally, remove the Winget package:

    winget uninstall Microsoft.OneDrive
    Note
    If you receive 0x800401F5: Application not found, it is safe to ignore the message if OneDrive has already been removed.

Step 2 - Install the Latest Version

Open PowerShell as Administrator and run:

Invoke-WebRequest "https://go.microsoft.com/fwlink/p/?LinkId=248256" -OutFile "$env:TEMP\OneDriveSetup.exe"
Start-Process "$env:TEMP\OneDriveSetup.exe" -Wait
Expected Result
  • The installation completes successfully.
  • OneDrive appears in the Start Menu.
  • You can sign in normally.

Verify the Installation

To display the installed OneDrive version:

(Get-Command "$env:LOCALAPPDATA\Microsoft\OneDrive\OneDrive.exe").FileVersionInfo.ProductVersion

OneDrive File Limits

Microsoft publishes supported limits, but not a recommended "safe" number of files. Based on Microsoft's documentation and extensive user experience, the following ranges are practical.

Total Items (Files + Folders) Recommendation
< 100,000 🟢 Very safe
100,000 - 250,000 🟢 Generally fine on modern PCs
250,000 - 400,000 🟡 Usually OK, but performance may begin to decline
400,000 - 600,000 🟠 Increased risk of slow synchronization and client issues
> 600,000 🔴 Not recommended unless you have already verified your setup can handle it
Recommended Target
For the best long-term stability, try to keep the total number of synced items below 250,000.

Recommended ZIP File Size

If you store your files inside ZIP archives, these are sensible size guidelines.

ZIP Size Recommendation
5-10 GB Excellent. Easy to upload, download, copy and restore.
10-20 GB ⭐ Recommended. Best balance between archive size and convenience.
20-50 GB Still a very reasonable size.
50-100 GB Acceptable, although uploads and verification take longer.
>100 GB Avoid unless you have a specific requirement.
Recommendation
For most users, archives between 10 GB and 20 GB provide the best balance of upload speed, reliability, and recovery time.

Summary

  • Always try a OneDrive reset before reinstalling.
  • If resetting fails, perform a complete uninstall before installing the latest version.
  • Keep the total number of OneDrive items below 250,000 whenever possible.
  • For archived data, ZIP files between 10 GB and 20 GB are generally the most practical.

Total page views:

Comments

Popular posts from this blog

Useful aliases

Create rish shortcut on Home Screen

Check Change Files in Git