none
Cannot create symbolic links as administrator

    General discussion

  • Using MKLINK, I receive the following error when trying to create a symbolic link to a directory:

    "You do not have sufficient privilege to perform this operation"

    The command I use, for example is:  mklink /d c:\images c:\data\images

    I checked in the Local Security Polcies for User Rights Assignment, and the Security Setting for Create symbolic links is set
    to Administrators. The user I am logged on with is in the Administrators Group.

    Any ideas or similar experiences?
    • Edited by JWBam Monday, February 22, 2010 1:49 PM corrected mispelling
    Monday, February 22, 2010 5:55 AM

All replies

  • Hi, have you tried run "cmd" as Administrator? If I run "cmd" as Administrator, I do not get this error message.
    Sean Zhu - MSFT
    Wednesday, February 24, 2010 12:55 AM
  • Hi, have you tried run "cmd" as Administrator? If I run "cmd" as Administrator, I do not get this error message.
    Sean Zhu - MSFT

    I'm afraind that a year later the problem still exists, and the fix does not work.

    From an administrator (user: admin) shell:

    C:\Users\admin>mklink toggleNic ..\public\ToggleIPadrs.cmd
    You do not have sufficient privilege to perform this operation.

    C:\Users\admin>CMD /C "mklink toggleNic ..\public\ToggleIPadrs.cmd"
    You do not have sufficient privilege to perform this operation.

    Direct or via cmd, MKLINK doesn't work. Yet, there is a veritable MESS of links in my Windows 7 installation. 

     

    I would like to know where to get official Microsoft explanations of MKLINK:

     a. how to create symbolic links, as clearly the help from "MKLINK /?" doesn't work,

    and

    b. WHY doesn't it work?

    and

    c. what is the differences between hard and symbolic links.

     

    Eb

    Wednesday, January 12, 2011 7:43 PM
  • > b. WHY doesn't it work?

    For your safety. You have payed the money and we provide best security we can. We create facilities that do not work for your security. Something dangerous can happen to your data if you create a link. We prohibit file creation in the next release of our OS.

    Wednesday, April 13, 2011 1:31 PM
  • Eb,

    Look at this article this explains clearly how you can use the MKLink command in Windows 7.
    http://www.windows7home.net/how-to-create-symbolic-link-in-windows-7/

    If you say you run an administartor shell, can you see in the title of that shell starts with "Administrator:"?

    To answer your questions.
    A. It does work on Windows 7.

    B. see anwser A.

    C. Hard Link
    A hard link directly points to the file, and acts to the operating system as if it is the file itself. You’ll want to use this option the majority of the time if you are trying to fake an application’s directory.

    Soft Link
    A soft link is essentially a shortcut to a file or folder – if you are using Windows explorer, you’ll be redirected to the directory if you double-click on a shortcut, it won’t pretend its part of the filesystem. You can still directly reference or open a file with the symlinked path, and it mostly works.


    IM me - TWiTTer: @DFTER
    Thursday, April 14, 2011 10:58 AM
  • Did you right click on the 'command prompt' icon, and pick 'run as administrator'?

    It's also possible to set permissions on a file so that you can't make a hard link to it, even with high integrity, like svchost.exe.

     

     

    Thursday, April 14, 2011 5:05 PM
  • > b. WHY doesn't it work?

    For your safety. You have payed the money and we provide best security we can. We create facilities that do not work for your security. Something dangerous can happen to your data if you create a link. We prohibit file creation in the next release of our OS.

    Since MS doesn't fix things in days or months, but takes years, I only visit here every now and then ;-).

     

    Alright! Prohiibit file creation!  Thanks for the heads up. I guess Ill have to create a bunch of dummy files now, in preparation for the next realease. Now don't tell me, that the release AFTER next will also prohibit file modification?

    Wednesday, August 10, 2011 5:51 PM
  • If you say you run an administartor shell, can you see in the title of that shell starts with "Administrator:"?

    To answer your questions.
    A. It does work on Windows 7.

    B. see anwser A.

    C. Hard Link
    A hard link directly points to the file, and acts to the operating system as if it is the file itself. You’ll want to use this option the majority of the time if you are trying to fake an application’s directory.


    Soft Link
    A soft link is essentially a shortcut to a file or folder – if you are using Windows explorer, you’ll be redirected to the directory if you double-click on a shortcut, it won’t pretend its part of the filesystem. You can still directly reference or open a file with the symlinked path, and it mostly works.


    IM me - TWiTTer: @DFTER

    Thans for your reply.

    Yes I really did have an administrative shell. But the problem exists even if I log on as administrator.

    As to the explanation of hard versus soft links, the key thing I want to know, before experiment further is, what happens when you DELETE a link?

    Will deleting a hard link also delete the underlying file/folder?

    Will deleting a soft link leave the underlying file/folder untouched?

    How does a soft link differ from a windows shortcut?

    Finally (remeber, I cannot create these links) do both hard and soft links return their own path when queried (dir linkname), or do they return the underlying file's name?

     

    Thanks,

     

    Eb

    Wednesday, August 10, 2011 6:15 PM
  • Did you right click on the 'command prompt' icon, and pick 'run as administrator'?

    It's also possible to set permissions on a file so that you can't make a hard link to it, even with high integrity, like svchost.exe.

     

     


    No, I opened the admin shell via shortcut "C:\Windows\System32\runas.exe /user:heatpump\admin "cmd  /A /Q /T:1E"" where admin is the name of my administrative account.

    File permissions appear to be full control, but I'll have to look into that. Perhaps there is a folder permission involved.

     

    Thanks fot the tip.

    Wednesday, August 10, 2011 6:19 PM
  • I think "valtih1978" is an obvious troll, looking at his few posts and nowhere stating that he is part of Microsoft.
    Now Windows 8 is released and I can still create files fine. (Sorry if I'm wrong on the troll part)

    Anyway, I came here for the same problem. Looks like it got fixed by typing "command" in Start Menu's search, then right clicking Command Prompt and selecting Run As Administrator (as JS2010 said actually).

    • Edited by Cøi Wednesday, November 28, 2012 2:59 PM
    Wednesday, November 28, 2012 2:58 PM