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?
type CMD, you will see CMD.exe in the list at start menu.
Right click on it, select "Run as Administrator"
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.
First, make sure you've granted the "Create symlinks" permission to the relevant users, as detailed here: https://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.
If, for some reason, you cannot elevate your account to an administrator (eg. you're on a work computer), and you're trying to link a directory, try creating a junction instead of a hard/soft link. The source folder can be absolute or relative.
mklink /J linkedfolder sourcefolder
Check to see the "secondary logon" service isn't disabled.
If not installed, please installing Microsoft.net framework 2.0 or the service packs that go with it. It worked for me!