skeeto / w64devkit

Portable C and C++ Development Kit for x64 (and x86) Windows
The Unlicense
2.99k stars 210 forks source link

Creating symlink with ln fails with permission denied #141

Closed pgalkin closed 3 months ago

pgalkin commented 3 months ago

Windows 11 IoT. w64devkit is 1.23.0, freshly downloaded from Releases.

~ $ touch a
~ $ ln -s a b
ln: b: Permission denied
~ $ pwd
C:/Users/aragnir
~ $

Originally I wanted to do ln -s ~code/dotfiles/git/.gitconfig ~/.gitconfig and similar stuff for dotfiles but this blocked me.

pgalkin commented 3 months ago

I think I've discovered what the issue is. From https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/new-item?view=powershell-7.4#examples I see

Creating a SymbolicLink type on Windows requires elevation as administrator. However, Windows 10 (build 14972 or newer) with Developer Mode enabled no longer requires elevation creating symbolic links.