How to Prevent Invalid OneDrive File Names on macOS
Question details
Users need a way to block prohibited file-name characters from being typed into macOS Finder when naming files synced to OneDrive.

- Product
- OneDrive
- Device & OS
- macOS
- Scenario
- Creating or renaming files in the local OneDrive sync folder using the macOS Finder interface.
- Observed behavior
- The built-in OneDrive sync client does not display an immediate Finder error or provide a system policy to block prohibited characters as users type them.
Familiarize yourself with OneDrive's restricted file-name characters (such as <, >, :, ", |, ?, *, /, \) so you know exactly which inputs need to be filtered or avoided.
Use Third-Party macOS Automation Tools
Since OneDrive lacks a native macOS policy for this, you can utilize macOS folder automation tools to detect and correct invalid characters automatically.
The macOS Finder file system (APFS) natively allows certain characters that OneDrive restricts. Because the OneDrive client does not integrate with Finder at a level that blocks keystrokes in real-time, configuring a third-party automation tool to monitor your sync folders is the most effective workaround.
Download and install a macOS-compatible folder monitoring application, such as Hazel or a similar automation utility.
Open the automation tool and create a new monitoring rule, setting the target folder to your local OneDrive sync directory.
Set the rule condition to trigger when a file name contains restricted characters like *, ?, <, >, or |.
Add an action to the rule that automatically renames the file by replacing the invalid characters with a supported character, such as a hyphen or underscore.

Submit a Feature Request to Microsoft
Report this limitation directly to Microsoft to encourage the development of native macOS Finder integration for character blocking.
Experience Seamless File Management with WPS Office
If managing restrictive sync policies and file naming limits in Microsoft's ecosystem is disrupting your workflow, consider switching to WPS Office. It provides a lightweight, highly compatible alternative with seamless file management and built-in cloud support.
- 1. Download WPS Office: Visit the official WPS website to download the free macOS version of WPS Office.
- 2. Sign in to WPS Cloud: Launch the application and create or sign in to your account to activate your free WPS Cloud storage.
- 3. Save files seamlessly: Create your documents and save them directly to WPS Cloud, avoiding complex local system naming conflicts.

Frequently Asked Questions
What characters are strictly prohibited in OneDrive file names?
OneDrive restricts several characters that are common on other platforms. You cannot use <, >, :, ", |, ?, *, /, or \ in any file or folder name synced to OneDrive.
Why doesn't macOS Finder automatically block these restricted characters?
macOS uses the APFS or HFS+ file systems, which natively support many of the characters that Windows and OneDrive restrict. The OneDrive sync client does not have the operating system-level permissions required to block your keystrokes directly within Finder.
Can I use Power Automate Desktop on Mac to fix these files?
Power Automate Desktop is not natively available for macOS. However, you can use the web-based version of Power Automate to create cloud flows that monitor your OneDrive and automatically rename files containing invalid characters.




