I want to create a hardlink to a file using golang. os.Link() tells me, that windows is not supported. Therefore i tried to use os.exec, to call "mklink.exe".
cmd := exec.Command("mklink.exe", "/H", hardlink_path, file_path)
err := cmd.Run()
However, it tells me, that it can't find mklink.exe in %PATH%. This baffels me, since i can call it using cmd.
Next i tried to call it indirectly via cmd:
cmd := exec.Command("cmd.exe", "mklink.exe", "/H", hardlink_path, file_path)
err := cmd.Run()
Now it does not return any error, however, it also doesn't create a hardlink. Any suggestions?