{"id":63644,"date":"2024-04-16T19:08:49","date_gmt":"2024-04-16T18:08:49","guid":{"rendered":"https:\/\/ekiwi-blog.de\/63644\/create-symbolic-links-to-directories-in-windows\/"},"modified":"2024-04-16T19:08:49","modified_gmt":"2024-04-16T18:08:49","slug":"create-symbolic-links-to-directories-in-windows","status":"publish","type":"post","link":"https:\/\/ekiwi-blog.de\/en\/63644\/create-symbolic-links-to-directories-in-windows\/","title":{"rendered":"Create symbolic links to directories in Windows"},"content":{"rendered":"<p>Symbolic links with &#8220;mklink&#8221; in Windows.<\/p>\n<p><!--more--><\/p>\n<p>Recently I had the problem that I wanted to keep two &#8220;folders&#8221; in one application synchronised. So not synchronised in the sense of copying files, but one folder from each of two projects should always have the same content.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of content<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ekiwi-blog.de\/en\/63644\/create-symbolic-links-to-directories-in-windows\/#Symbolic_links_to_directories_in_Windows\" >Symbolic links to directories in Windows<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ekiwi-blog.de\/en\/63644\/create-symbolic-links-to-directories-in-windows\/#Remove_symbolic_links\" >Remove symbolic links<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Symbolic_links_to_directories_in_Windows\"><\/span>Symbolic links to directories in Windows<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Symbolic links can be used to point one directory to another. The display is transparent during use, i.e. it looks like a normal directory to users and programmes.<\/p>\n<p>Here is an example:<\/p>\n<pre>\r\nmklink \/D \"c:\\targetfolder\" \"c:\\sourcefolder\"\r\n<\/pre>\n<p>The parameter &#8220;\/D&#8221; creates a directory link from &#8220;sourcefolder&#8221; to &#8220;targetfolder&#8221;. The entry is made in the command prompt, whereby admin rights are required here.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2024\/04\/mklink_1.png\" alt=\"\" width=\"760\" height=\"69\" class=\"aligncenter size-full wp-image-63636\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2024\/04\/mklink_1.png 760w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2024\/04\/mklink_1-300x27.png 300w\" sizes=\"auto, (max-width: 760px) 100vw, 760px\" \/><\/p>\n<p>In Explorer, the target directory is symbolised with a small link arrow. If we look inside the folder, we see the same files. Changes to one folder lead to a change in the other folder. However, this is not entirely correct, as the files and folders only exist once.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2024\/04\/mklink_2.png\" alt=\"\" width=\"967\" height=\"145\" class=\"aligncenter size-full wp-image-63640\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2024\/04\/mklink_2.png 967w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2024\/04\/mklink_2-300x45.png 300w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2024\/04\/mklink_2-768x115.png 768w\" sizes=\"auto, (max-width: 967px) 100vw, 967px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Remove_symbolic_links\"><\/span>Remove symbolic links<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>We can also remove a link again using the &#8220;rd&#8221; command:<\/p>\n<pre>\r\nrd source\r\n<\/pre>","protected":false},"excerpt":{"rendered":"<p>Symbolic links with &#8220;mklink&#8221; in Windows.<\/p>\n","protected":false},"author":1,"featured_media":8064,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1555],"tags":[1558],"class_list":["post-63644","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-en","tag-windows-en"],"_links":{"self":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts\/63644","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/comments?post=63644"}],"version-history":[{"count":0,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts\/63644\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/media\/8064"}],"wp:attachment":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/media?parent=63644"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/categories?post=63644"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/tags?post=63644"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}