3

I created a directory symbolic link that points to an external drive:

mklink /D C:\local\work F:\work

I'm trying to remove it.
Opening cmd shell as administrator and running the command:

rmdir C:\local\work

Get the error:

Access is denied.

Same thing by using:

cmd /c rmdir C:\local\work

from a Windows Powershell.
Same error even using the Sysinternals' Junction tool:

junction -d C:\local\work

I also tried with:

fsutil reparsepoint delete C:\local\work

but I get the error:

The directory is not a subdirectory of the root directory.
The FSUTIL utility requires a local NTFS volume.

Any suggestions?

2
  • I'm having the same problem, can't remove dead symlink. Did you figure out?
    – Vadim K.
    Apr 18, 2019 at 20:39
  • I'm also having the same problem, deleting an empty directory from a Dropbox folder. There is no error message, but the directory survives delete in File Manager and rmdir in Powershell. Probably I have to logout and login again, I imagine, this being Microsoft and all. Jul 21, 2019 at 21:47

2 Answers 2

2

Did you try to select it in the explorer and just press Del?

Otherwise rmdir should be able to delete it. See also this question: How can I delete a symbolic link?

0
  1. The DOS internal mklink command does not work on FAT FS.
  2. To remove symlink, you need to exit anything that may use it, and tat includes anything that is ran by Powershell. Exit everything and start a new CMD as Admin, then run the cmd /c mklink /? (for testing availability), as this is not available directly from W10 CMD prompt.
  3. To remove, either use CMD with cmd /c del remove_me.exe (from within a CMD shell) or go into WSL and remove from there, as it is (probably?) better at handling symlink removals.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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