symbolic links on Windows
Asked Answered
P

1

0

I try to create symbolic link on Windows (as 1st answer to Is there any way to integrate Eclipse with Gradle in Android project?)

On linux it is

ln -s src/main/res res
ln -s src/main/AndroidManifest.xml AndroidManifest.xml

Windows 7 has mklink util, but it just did not work on my PC.

I found a great Junction util and could do junction res src/main/res, but for link to file is created .lnk file (aka Windows shortcut).

I discovered that Git Bash can execute ln -s src/main/AndroidManifest.xml AndroidManifest.xml but it creates copy, not link.

Pueblo answered 28/9, 2014 at 3:53 Comment(3)
Does whoami /priv show that your access token has SeCreateSymbolicLinkPrivilege? If not, try again in an elevated command prompt. mklink should work if the privilege is listed.Euroclydon
That's great. Even when running as Administrator I have "SeCreateSymbolicLinkPrivilege" as disabled. That is clue why it has failed. Now I have other question how to enabled it, but for this question it would be good to accomplish using mklink. So the answer should be use mklink and check "SeCreateSymbolicLinkPrivilege" with whoami /privPueblo
related to #15321050Pueblo
P
0

Use elevated-command-prompt

If error, check "SeCreateSymbolicLinkPrivilege", possibly turn off UAC.

Pueblo answered 28/9, 2014 at 11:43 Comment(3)
I don't recommend disabling UAC. The privilege to create symbolic links, like most other privileges, gets stripped from an administrator's access token until you elevate to get a privileged token. That's a good thing. If that annoys you, instead use a limited user account that you grant SeCreateSymbolicLinkPrivilege.Euroclydon
I generally agree, but in my case SeCreateSymbolicLinkPrivilege is disabled even in elevated command prompt. Is there way to grant SeCreateSymbolicLinkPrivilege to particular user?Pueblo
The group policy editor, gpedit.msc, is used to grant privileges to a user account.Euroclydon

© 2022 - 2024 — McMap. All rights reserved.