How can I get permission to create a symbolic link?

I am trying to create a symbolic link from a program, but I keep getting:

A required privilege is not held by the client.

I am running the program from my account which is in the Administrators group, and otherwise has admin rights. However, if I login to the Administrator account the program runs fine, so I know the program code is correct.

I have checked the local security settings, and even added my account explicitly to the local security settings to create symbolic links, but that does not help. I have also turned of UAC, but that does not help.

What do I need to do on Windows 8.1 to be able to create a symbolic link from an account other than Administrator?

Cheers

February 14th, 2014 5:48pm

Hi Eric,

Can you be more specific about the kind of program you are using and what folders you are attempting to create a link from / to? For example, if you were using this Symbolic Link tool here, and you were trying to create a link from C:\Program Files\Test to C:\Program Files\Test Redirect, you will want to run the application as an administrator by right clicking on the application and selecting, "Run as administrator." Next, you will want to select the path of the link folder, name the link, ex: "test link" and then select the destination folder, and press Create Link. 

If you are using a different kind of application, please provide as much detail as possible.

Jessica
Windows Outreach Team -- IT Pro

Free Windows Admin Tool Kit Click here and download it now
February 14th, 2014 9:25pm

Basically I have a Scala program that is doing:

  try {
    Files.createSymbolicLink(link21, folder1)
  }
  catch {
    case fileSystemException: FileSystemException =>
      System.err.println("\n\t**** Error configuring test fixture ***\n\n")
      println(fileSystemException)
      if (fileSystemException.getMessage().contains("A required privilege is not held by the client"))
        println("You need to set permissions by...\n")
  }

Where Files is the java.nio API. In fact it's a unit test fixture that tests to make sure my code handles symbolic links properly. The test fixture creates a temporary directory, for example

C:\Users\Eric\AppData\Local\Temp\testFolder-432432684744817467

and more files and folders below that. In one folder, it tries to make a symbolic link to another folder.

I tried what you said with Run As Administrator, in this case, I ran my Eclipse IDE as Administrator and the code works -- thanks for the tip :-)

However, in practice, I need this to work as part of automated unit test running as part of a Maven build, so is there some way to set things up that do not require "Run As Administrator"?

Now that I have one solution, I can probably figure out some hack, but I was hoping there would be some more simple straightforward way to do what I want.

February 15th, 2014 1:07am

Hi,

We need the permission to access some system files.

You can try to use the process monitor to capture the event during you run this program without running as Admin.

Solving Access Denied Errors Using Process Monitor

http://improve.dk/solving-access-denied-errors-using-process-monitor/


We can take the ownership of the required file which getting access denied results in the process monitor.

Hope this can do what you would like.

Free Windows Admin Tool Kit Click here and download it now
February 19th, 2014 3:02pm

I installed process monitor and then ran the test, which failed in the normal way. However, looking at the log, I cannot see anything strange. I was able find the process that is running the tests, but cannot see exactly where trying to create the symbolic link is failing.

Basically I am filtering on the PID and result != SUCCESS.

Cheers, Eric

February 19th, 2014 11:15pm

Run the program as a regular user (that has the create symlink permission set explicitly) or as _elevated_ user.

See the link for details: http://superuser.com/questions/839580/how-can-i-create-symbolic-links-in-windows-8-1-without-an-admin-command-prompt

P.S. Posting here as it may be useful for anyone who googled the issue.

Free Windows Admin Tool Kit Click here and download it now
June 21st, 2015 2:55am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics