If I manually run the following command in Windows, it runs fine and creates the Junction Directory.
mklink /j "c:\Users\userid\OneDrive - Enterprise 365\backup\C\Users\userid\test" c:\Users\userid\test
But, if I do it programmatically with Go, using the following code, it comes back with Local NTFS volumes are required to complete the operation.
mklink := "mklink /j \"c:\\Users\\userid\\OneDrive - Enterprise 365\\backup\\C\\Users\\userid\\test\\\" c:\\Users\\userid\\test"
cmd := exec.Command("cmd", "/c", mklink)
out, err = cmd.CombinedOutput()
I've tried it a few different ways, but always getting the same result.
Any ideas?
I noticed the version for Go, you have a trailing backslash after 'test' in the OneDrive path. This could be a subtle Windows behavior.
Another possibility - "mklink /j" requires an elevated command prompt. If your Go script is not running in such an Admin-mode window, it cannot create a Junction Point (or a hard link to a file).