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.

Community
  • 1
  • 1
Paul Verest
  • 60,022
  • 51
  • 208
  • 332
  • 1
    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. – Eryk Sun Sep 28 '14 at 10:14
  • 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 /priv` – Paul Verest Sep 28 '14 at 10:55
  • related to http://stackoverflow.com/questions/15320550/secreatesymboliclinkprivilege-ignored-on-windows-8 – Paul Verest Sep 28 '14 at 10:57

1 Answers1

0

Use elevated-command-prompt

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

Paul Verest
  • 60,022
  • 51
  • 208
  • 332
  • 2
    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`. – Eryk Sun Sep 28 '14 at 11:54
  • I generally agree, but in my case SeCreateSymbolicLinkPrivilege is disabled even in elevated command prompt. Is there way to grant SeCreateSymbolicLinkPrivilege to particular user? – Paul Verest Sep 29 '14 at 02:42
  • The group policy editor, gpedit.msc, is used to grant privileges to a user account. – Eryk Sun Sep 30 '14 at 21:41