title: How to create symbolic links for multiple files in multiple folders using command prompt or power shell?
body: <p>I have two main folders which have a lot of sub-folders in different drives. Have to create symbolic link for all files in the second folder into the first one.</p>
  
  <pre><code>C:\folderC&gt;tree /f
  C:.
  ├───folder1
  │       file1.txt
  │       file3.txt
  │
  └───folder2
          file1.txt
          file3.txt
  
  D:\folderD&gt;tree /f
  D:.
  ├───folder1
  │       file2.txt
  │
  └───folder2
          file2.txt
  </code></pre>
  
  <p>Result using 2 commands:</p>
  
  <pre><code>C:\&gt;mklink C:\folderC\folder1\file2.txt D:\folderD\folder1\file2.txt
  symbolic link created for C:\folderC\folder1\file2.txt &lt;&lt;===&gt;&gt; D:\folderD\folder1\file2.txt
  
  C:\&gt;mklink C:\folderC\folder2\file2.txt D:\folderD\folder2\file2.txt
  symbolic link created for C:\folderC\folder2\file2.txt &lt;&lt;===&gt;&gt; D:\folderD\folder2\file2.txt
  
  C:.
  ├───folder1
  │       file1.txt
  │       file2.txt
  │       file3.txt
  │
  └───folder2
          file1.txt
          file2.txt
          file3.txt
  </code></pre>
  
  <p>How to make it for all files with a few commands instead of writing the code manually for each file?</p>
  
  <p>PS: Firstly I wanted to use hard links but it seems it is not possible.</p>
  
  <pre><code>C:\&gt;mklink /h C:\folderC\folder2\file2.txt D:\folderD\folder2\file2.txt
  The system cannot move the file to a different disk drive.
  </code></pre>