access-deniedwindows-11mklink

Given an "Access is denied" error when attempting to establish a hard link


Im starting a new project and part of my project setup is to establish a hard link with the game and where I program, I do this to keep from acidentily deleting the project(I've done this in the past). Usally, it works just fine but it did not work today. The cmd I ran was:

mklink /H "C:\Users\(user)\curseforge\minecraft\Instances\1.20.1 quilt\saves\fight test\datapacks\thewolfhearted fight moves" "C:\Users\(user)\MCdatapacks\Thewolfhearted Fighting Moves\Thewolfhearted Fighting Moves"

OS:Windows 11

I can add more information as it is requested.

I have tried rebooting and running cmd as admin, could not find anything else to try.


Solution

  • The soulution i found was just to not use a hard link, the fact that it worked before was a bug, so this is the intended way for it to work. I instead used a junction, which should work for all intents and purposes.