Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I was trying to use mklink command in cmd (i have Windows 7 os) I was logged on as administrator, but i got a " you do not have sufficient privilege to perform this operation" message. I used the same command in Vista, it worked ok. Any ideas why it does not work in Winows 7?

share|improve this question
add comment

5 Answers

Try explicitly running the cmd shell as administrator. If that doesn't help, then try the runas command.

runas /user:administrator "mklink args"

Quotes around the mklink command and its args are required.

share|improve this answer
8  
Symlinks are too dangerous for a normal user. LOL. I wish I could understand the considerations behind this. :-( –  Notinlist Apr 14 '11 at 13:34
    
My user is an administrator (there is no user called "administrator" on this machine.) but I still get "You do not have sufficient privilege to perform this operation." –  Jonathan Hartley Jan 8 '12 at 18:35
1  
This answer, although helpful advice in the general case, seems to be exactly the opposite of the behaviour I'm observing: mklink only works for me when my user is not an administrator. Puzzling. –  Jonathan Hartley Jan 9 '12 at 0:41
add comment

type CMD, you will see CMD.exe in the list at start menu.

Right click on it, select "Run as Administrator"

share|improve this answer
add comment

First, make sure you've granted the "Create symlinks" permission to the relevant users, as detailed here: http://superuser.com/a/125981/57697

Bizarrely, the "mklink" command will not work for me if my user is an administrator. It gives "You do not have sufficient privilege to perform this operation."

To make it work, I then need to either remove my user from the administrators group, or run mklink from a cmd which has been run as a non-admin user such as guest:

   runas /user:guest cmd

(enable the guest account if it isn't already)

Using this latter method, you'll also have to temporarily grant permissions for 'guest' to modify the location you're creating the symlink in, which in my case was my home directory, causing a flurry of error dialogs, but they seemed harmless.

share|improve this answer
add comment

In response to this not working for administrator accounts, I believe that Configuring symlink support in Win7 is relevant.

After giving “Everyone” the privilege “Create symbolic link”, please reboot (or log off) and log in as a standard user, a user who is NOT a member of group “Administrators”. You should be able to create a symbolic link using mklink command in a directory where user has write permissions.

The reason a member of “Administrators” cannot create symbolic link is because “Create symbolic link” privilege is removed from the filtered token since user is a member of “Administrators” group. Section “Access Token Changes” of article at link http://msdn.microsoft.com/en-us/library/bb530410.aspx describes in more details on how filtered token is created.

share|improve this answer
add comment

Check to see the "secondary logon" service isn't disabled.

share|improve this answer
3  
As a highly valued Super User, I suggest you revisit this answer and add more detail. –  KronoS Jul 27 '12 at 21:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.