# Sync any folder in Windows to OneDrive

OneDrive is great piece of software but at the time of writing it misses some of the features that competitors…

blog

16 Feb 2018 en

![Sync any folder in Windows to OneDrive](/wp-content/uploads/2018/02/OneDrive.png)

[View images (7)](#pf-content-image-1-0)

**OneDrive** is great piece of software but at the time of writing it misses some of the features that competitors (in particular **Google Drive**) like linking any folder to **OneDrive**. You can only synchronize data from **OneDrive** to your user folder (or wherever you define it). But you can't tell **OneDrive** to synchronize C:\Support, D:\MyFolder, C:\MySuperHiddenFolder.

[!\[Windows File Explorer with the Support folder selected on C: drive\](/wp-content/uploads/2018/02/img_5a86c1e39b4a3.png)](/wp-content/uploads/2018/02/img_5a86c1e39b4a3.png)

Well at least not natively… unless you use the trick below.

### ✅ Solution

The way to solve is by using neat feature called **Symbolic Links**. **Symbolic links are basically advanced shortcuts**. Create a symbolic link to an individual file or folder, and that link will appear to be the same as the file or folder to Windows—even though it’s just a link pointing at the file or folder. Since I wanted to synchronize C:\Support to OneDrive, all I had to do was…

- Rename C:\Support to C:\Support-Old

[!\[Windows File Explorer showing the renamed Support-Old folder on C: drive\](/wp-content/uploads/2018/02/img_5a86c358ebc3d.png)](/wp-content/uploads/2018/02/img_5a86c358ebc3d.png)

- Open **CMD** as **Administrator **and use mklink application that's brought to you by Microsoft as hidden gem

[!\[Administrator Command Prompt showing mklink help text\](/wp-content/uploads/2018/02/img_5a86c95766ce8.png)](/wp-content/uploads/2018/02/img_5a86c95766ce8.png)

- Run following command – where Targetfolder shouldn't exists (keep in mind REM below means it's a comment). So just one simple command is necessary

```msdos
REM mklink /J
mklink /J "C:\Support" "C:\Users\pklys\OneDrive - Evotec\Support"
```

[!\[Administrator Command Prompt creating a junction from C:\Support to OneDrive\](/wp-content/uploads/2018/02/img_5a86c3e9ceacc.png)](/wp-content/uploads/2018/02/img_5a86c3e9ceacc.png)

- Notice how the folder has special arrow next to it. It means it's Hard Linked now.

[!\[File Explorer showing the junction arrow overlay on C:\Support\](/wp-content/uploads/2018/02/img_5a86c490b7959.png)](/wp-content/uploads/2018/02/img_5a86c490b7959.png)

- Now anything you create in **C:\Support** (or folder of your choice for that matter) folder or on your **OneDrive** will get synchronized both ways (technically it's same file – no synchronization occurs). Isn't that great?

[!\[File Explorer showing a new folder inside C:\Support\](/wp-content/uploads/2018/02/img_5a86c4e8b961e.png)](/wp-content/uploads/2018/02/img_5a86c4e8b961e.png)

- Gets **hardlinked** to **OneDrive**, and at same time synchronized by **OneDrive** to Cloud!

[!\[File Explorer showing the same new folder in OneDrive\](/wp-content/uploads/2018/02/img_5a86c5148b8b8.png)](/wp-content/uploads/2018/02/img_5a86c5148b8b8.png)

And best of all **it doesn't take double spac**e on your drive. Enjoy!

PS. To get rid of a **symbolic** link, you can simply delete it like you would any other file or directory. Just be careful to delete the link itself rather than the file or directory it’s linking to. In my case this would be deleting **C:\Support** rather then the folder on **OneDrive**.

## Related Projects

Projects that align with this post's tags, categories, and content.

[All projects](/projects/)

Matching projects...

[Back to Blog](/blog)

## Related posts

- [The program can’t start because mfc120ud.dll is missing from your computer](/blog/program-cant-start-mfc120ud-dll-missing-computer/)
- [Windows 10 – You’ll need the internet for this 0xCAA7004 or 0xCAA30194 or 0x80072EFD](/blog/windows-10-youll-need-the-internet-for-this-0xcaa7004-or-0xcaa30194/)
- [PowerBGInfo 2.x: support-ready Windows backgrounds from PowerShell](/blog/powerbginfo-support-ready-windows-backgrounds/)

<!-- PowerForge markdown artifact sha256:73EA35584AAB26FBA592EB688CCE5CE10748DED6168A21D675AA5DCDE31CBA2B -->
