logo
search
OneDrive File Issues

How to Sync External Folders with OneDrive Using Symbolic Links

Muhammad TalhaMuhammad Talha Oct 21, 2026 868 views

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.

How to Sync External Folders with OneDrive Using Symbolic Links
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.
Before you start

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.

Solution 1Recommended

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.

1
Open Command Prompt as Administrator

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'.

2
Identify your folder paths

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').

3
Execute the mklink command

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".

4
Verify synchronization

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.

Create a Directory Symbolic Link via Command Prompt
Important Considerations: If you delete the symbolic link from your OneDrive folder, the original files in the external folder will remain unaffected. However, deleting files from inside the linked folder will delete them from the original location.
Free Microsoft Office alternative

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.

Fully compatible with Microsoft Office formats (.docx, .xlsx, .pptx) to ensure smooth collaboration.Includes a built-in cloud service (WPS Cloud) for effortless cross-device synchronization.Lightweight design ensuring fast installation and smooth performance even on older devices.Familiar user interface makes switching from Microsoft Office seamless and intuitive.
microsoft office alternative - wps office

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.