How to Sync External Folders with OneDrive Using Symbolic Links
Question details
The user wants to synchronize local folders that are located outside of the default OneDrive directory without moving the actual files from their original location.

- Product
- Microsoft OneDrive
- Device & OS
- Windows
- Scenario
- Organizing and syncing local files to OneDrive without changing their original folder locations on the hard drive.
- Observed behavior
- Folders located outside the designated OneDrive directory are not automatically synced to the cloud.
Ensure you have administrator privileges on your computer, as creating symbolic links requires elevated Command Prompt access. Verify the exact file paths for both your OneDrive directory and the external folder you wish to sync.
Create a Directory Symbolic Link via Command Prompt
Use the 'mklink' command to create a virtual link inside your OneDrive folder that points to your external data folder.
A symbolic link acts as a shortcut that the operating system treats as an actual folder. By placing a symbolic link inside your OneDrive folder, OneDrive will sync the contents of the target external folder as if they were natively located there.
Note that the target folder must reside on the same computer, and some organizational IT policies may restrict the use of symbolic links.
Click the Windows Start menu, type 'cmd' or 'Command Prompt' into the search bar, right-click the Command Prompt app, and select 'Run as administrator'.
Determine the exact path of the location inside your OneDrive folder where you want the link to appear (e.g., 'D:\One Drive\My work') and the path of the external folder you want to sync (e.g., 'E:\Data\My work').
In the Command Prompt, type the command using the syntax: mklink /D "[OneDrive Path]" "[External Folder Path]" and press Enter. For example: mklink /D "D:\One Drive\My work" "E:\Data\My work".
Open your OneDrive folder in File Explorer to confirm the linked folder has appeared. The OneDrive client will now recognize the files and begin syncing them to the cloud.

Manage Your Documents Seamlessly with WPS Office
While OneDrive handles your file synchronization, WPS Office provides a lightweight, robust, and completely free alternative to Microsoft Office for editing your synced Word, Excel, and PowerPoint files.

Frequently Asked Questions
Can I use symbolic links to sync a network drive with OneDrive?
Generally, OneDrive does not support syncing network drives directly, even with symbolic links. The target folder being linked should reside on a local disk on the same computer where the OneDrive client is installed.
Will deleting the symbolic link delete my original files?
No, deleting the symbolic link itself (the shortcut inside the OneDrive folder) will only stop the syncing process. Your original files in the external folder will remain completely intact.
Why do I get an 'Access Denied' error when creating the mklink?
Creating symbolic links requires administrative privileges. Ensure you have opened the Command Prompt by right-clicking it and selecting 'Run as administrator'. Additionally, check if your organization's IT policies restrict the creation of symbolic links.
Can I sync files outside the OneDrive folder on Mac?
Yes, but the process requires different commands. On macOS, you would use the Terminal to create a symbolic link using the 'ln -s' command instead of the Windows 'mklink' command.




