# 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 pl

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

[Zobacz obrazy (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.

[!\[Eksplorator plików Windows z zaznaczonym folderem Support na dysku C:\](/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

[!\[Eksplorator plików Windows pokazujący folder Support-Old po zmianie nazwy na dysku C:\](/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

[!\[Wiersz polecenia administratora z pomocą mklink\](/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"
```

[!\[Wiersz polecenia administratora tworzący punkt połączenia z C:\Support do 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.

[!\[Eksplorator plików pokazujący ikonę punktu połączenia przy 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?

[!\[Eksplorator plików pokazujący nowy folder wewnątrz 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!

[!\[Eksplorator plików pokazujący ten sam nowy folder w 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**.

## Powiązane projekty

Projekty powiązane z tagami, kategoriami i treścią tego wpisu.

[Wszystkie projekty](/projekty/)

Trwa dopasowywanie projektów...

[Powrót do bloga](/blog/)

## Powiązane wpisy

- [Check an API write after a PowerShell timeout](/blog/verify-uncertain-api-outcomes-powershell/)
- [Inspect and convert mixed Office archives with PSWriteOffice](/blog/inspect-and-convert-mixed-office-archives-pswriteoffice/)
- [Compose PDF reports and automate page workflows with PSWriteOffice](/blog/automate-pdf-reports-and-page-workflows-pswriteoffice/)

<!-- PowerForge markdown artifact sha256:289F8B3A727E6AD638D954B9BE37ECFC0CB3C78A55B7671DC45683591EDC616F -->
