4

I am trying to get a symlink working over a network drive.

I have already tried suggestions on questions already asked, such as running as administrator and checking if the directory already exists. Unfortunately it still gives me the following error:

C:\Windows\system32>mklink /d \\myserver\someLink \\myserver\mydir
Access is denied.

Any ideas how I could get this working? The local machine is running windows 7 and the remote machine is running windows server 2008 R2 standard.

mikemaccana
  • 110,530
  • 99
  • 389
  • 494
Blueberry
  • 2,211
  • 3
  • 19
  • 33

3 Answers3

5

I jumped through all the hoops:

  1. Create a non-admin account (in my case, activated the guest account).
  2. As Admin, run secpol.msc and grant this account Create Symbolic Link permissions.
  3. runas /user:guest cmd to open a command window as the guest.

    only to get caught on the simplest problem: because I was running as guest, I didn't have write permissions within the directory. So,

  4. As admin, change permissions in the target directory (where you want to make the link) to give write access to the non-admin user.

Mihai Iorga
  • 39,330
  • 16
  • 106
  • 107
  • If I can `mkdir foo`, is that indicative that I have the necessary permissions? I had already given the "Create Symlink" permissions to the whole `Users` group. This is on a mapped network drive. – Michael Mar 20 '14 at 15:49
  • Note for future visitors: If your account *has* admin permissions, and you are trying to run as that account, [you have to disable UAC](http://superuser.com/questions/124679/how-do-i-create-a-link-in-windows-7-home-premium-as-a-regular-user#comment788686_311078) (because "reasons"). – Michael Mar 20 '14 at 21:11
1

I had this while I wanted to create a hard link with mklink /H .... By removing the /H, the error vanished as well.

So if a symbolic link does the trick for you as well, you should try this.

Waescher
  • 5,361
  • 3
  • 34
  • 51
1

This is a little silly, but make sure you're using /D (soft) or /J (hard) for directories or you'll get access denied.

msq
  • 146
  • 7