Handle desktop.ini Files Blocked by OneDrive Sync
Question details
The user needs a practical way to handle desktop.ini files blocked by OneDrive during large-scale migrations.

- Product
- Microsoft OneDrive
- Device & OS
- not provided
- Scenario
- Migrating files from Work Folders or another storage system into OneDrive for many users.
- Observed behavior
- OneDrive blocks desktop.ini files and reports synchronization errors; deleting the files may not be practical because Windows can regenerate them.
Check the OneDrive sync error details to confirm that desktop.ini is the affected file. Identify whether the files are being copied into local OneDrive folders or uploaded through a migration tool, because the available exclusions differ.
Exclude desktop.ini from Windows migration copies
Use a filename exclusion when copying migration data on Windows so source desktop.ini files are not copied into the destination.
This prevents the specified source files from being copied; it does not stop Windows from creating new desktop.ini files later or resolve existing OneDrive sync errors.
In File Explorer, locate the source folder and the intended local OneDrive destination folder. Confirm that your migration process permits a direct file copy.
Open Command Prompt and run: robocopy "C:\Source" "C:\Users\User\OneDrive - Organization\Destination" /E /XF desktop.ini. Replace both paths with the actual source and destination paths.
Check the Robocopy output for copy failures, then select the OneDrive cloud icon and open its sync problems view to check for remaining errors.
Check OneDrive administrator exclusion policies
For managed deployments, ask an administrator to evaluate OneDrive's filename upload exclusion policy before applying it broadly.
Review and remove individual blocked desktop.ini files
For isolated errors, identify the affected files and remove them where folder customization is not needed.
Work with Office Documents in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with Microsoft Office files during and after a migration. It does not change OneDrive's sync rules or fix desktop.ini errors.

Frequently Asked Questions
Can I force OneDrive to sync a blocked desktop.ini file?
OneDrive does not provide a standard user setting to force synchronization of blocked desktop.ini files. Instead, review the sync error and consider excluding the file from the migration copy.
Why does desktop.ini return after I delete it?
Windows can recreate desktop.ini to store folder display settings. For large migrations, excluding the filename in the copy process is generally more practical than repeatedly deleting it.
Can administrators exclude desktop.ini from OneDrive uploads?
Administrators can evaluate the OneDrive policy "Exclude specific kinds of files from being uploaded" and test a filename entry. Its behavior and scope should be verified against current Microsoft documentation before deployment.
Will excluding desktop.ini prevent other files from being copied?
The Robocopy option /XF desktop.ini excludes files with that name from the copy. Other files are still subject to permissions, path limits, and any other options used in the command.




