Windows Symbolic Links to Folders
Posted on Jul 23rd, 2020
In an interesting way I needed more control over folders and where they point on my PC. As a notion to share a bit, you can learn how to make symbolic links for yourself.
On the amusing side, this came from me needing to point to a single ‘saves’ directory for my Minecraft worlds. Every few months they release a new version, so it always uses the same folder. When you’re like me and use Litematica and Replay Mod at times you would notice that you cant keep jumping between folders. Similarly, if you’re like me you don’t want to have excess folders just inside your Minecraft install directory.
Take note, I’m sharing the example that brought my need to create symbolic links. I use MultiMC to launch my modpacks, I just wanted to make a modded version use the unmodded folder.
A Symbolic Link in Windows is essentially much like a link here on the internet, just within your computer. You can make a folder that is a link to a folder elsewhere on your computer. Sure, this can be used in more ways, such as over the network link, we will just focus on within our own computer.
Create a Symbolic Link
- Open ‘Windows PowerShell’ by searching for it in the ‘Start Menu’, right-clicking it, select ‘Run as Administrator’.
- Navigate to where you want to put the symbolic link.
- Input the following line, take note of what you change for yourself:
New-Item -ItemType <Item Type> -Path "<Name>" -Target "<Target>"
Take note the items in ‘<>’ quotes:
- <Name>: Put the name you want to call the symbolic link
- <Target>: Put the where you want it to point to
- <Item Type>: ‘SymbolicLink’, ‘Junction’, or ‘HardLink’
Running that command will then create your symbolic link, for example:
Now for any application I can set the output folder to ‘C:\temp\c_drive’ and it will place output in ‘C:\’ since that was the silly example link I made.
The Item Types
Firstly, it should be pointed out, you don’t need administrator privileges for all of the Item Types, it’s just a good habit I stick to. Also, you can make a File or Directory directly with the New-Item command, that’s not our purpose here.
- SymbolicLink: Create a link between directories, can be to network paths
- Junction: Create a link between directories, has some limitations such as not allowing network paths, so usually we will stick to a SymbolicLink
- HardLink: Create a link to a file, has limitations like it wont allow directories, so usually we stick to a SymbolicLink
As you can note, the SymbolicLink option can be used in the circumstances we would need to point to different folders.
For example, in the MultiMC folder I mentioned I go to the instance’s ‘.minecraft’ folder, delete ‘saves’ and create a Symbolic Link to my other instance’s ‘saves’.