Can't delete folders/files within a symbolic link or junction mklink

Page 1 of 3 123 LastLast

  1. Posts : 12
    Windows 10
       #1

    Can't delete folders/files within a symbolic link or junction mklink


    I used mklink to create a symbolic link /d to a hard drive.


    Now, even though I am the owner, confirmed by the "Take Ownership" process, I cannot delete files located in this symbolic link. For example, if I navigate to the link folder E:\Movies which points to my 14TB Movies hard drive F:\ and I try to delete a folder, I get an error "You'll need to provide administrator permission to delete this folder". When I go to Properties > Security and check the ownership, my user name is listed as owner.


    I can however delete the individual files within this folder, but I cannot delete the folder itself. I tried this with both mklink /d and junction /j.

    E:\ - Drive with symbolic link folder "Movies" which points to drive F:\
    F:\ - 14TB hard drive containing media files


    If I instead navigate directly to the hard drive and not through the symbolic link, I can delete anything I want.


    Is there a setting or something that I am missing that is causing this? My intention was to create a symbolic link to this hard drive so that it would look like a folder within my Videos folder/library instead of a separate drive.


    Any help is appreciated!
      My Computer


  2. Posts : 2,800
    Windows 7 Pro
       #2

    Hi,

    Try to use SysInternals Junction Utiltity

    https://docs.microsoft.com/en-us/sys...loads/junction
      My Computers


  3. Posts : 12
    Windows 10
    Thread Starter
       #3

    MaloK said:
    Hi,

    Try to use SysInternals Junction Utiltity

    https://docs.microsoft.com/en-us/sys...loads/junction
    Thanks for the suggestion, MaloK
    I have downloaded the Junction.zip and extracted it, but I may need help learning how to use it.

    I ran junction64.exe (as administrator) and did not see anything happen... I then opened cmd as administrator and tested the commands -
    junction F:\Movies F:\000MoviesHDD

    Received this error:
    "'junction' is not recognized as an internal or external command,operable program or batch file."

    Also, how is this different than the Windows mklink operation?
      My Computer


  4. Posts : 2,800
    Windows 7 Pro
       #4

    Hi,

    Try to extract all exe in system32, it will give you direct access to the command across windows.

    I just did the exercise you described and the link was created and works properly.

    I don't know the difference between the method both uses. But I have never had write problem trough a link created with junction.exe
      My Computers


  5. Posts : 12
    Windows 10
    Thread Starter
       #5

    MaloK said:
    Hi,

    Try to extract all exe in system32, it will give you direct access to the command across windows.

    I just did the exercise you described and the link was created and works properly.

    I don't know the difference between the method both uses. But I have never had write problem trough a link created with junction.exe
    Thanks again. After extracting to System32, i successfully created the juncion, but I'm getting the same error when I try to delete a folder. See the screenshot:
    Can't delete folders/files within a symbolic link or junction mklink-capture.png

    There is something going on with permissions and I can't for the life of me figure it out...

    I tested out the regular mklink /d on my other laptop and I am able to write/delete in it just fine... but for some reason I get a permissions error on my desktop

    Also, I have set the permissions for both the F:\000MoviesHDD and the new junction/symlink so that I am the owner of both:
    Can't delete folders/files within a symbolic link or junction mklink-capture.png
      My Computer


  6. Posts : 2,800
    Windows 7 Pro
       #6

    Open an administrative cmd prompt: pls post back windows replies.
    Code:
    Net user YourUserName
    And verify your local group membership.

    Verify folder security on your target directory:
    Code:
    icacls F:\000MoviesHDD
    Verify If there is no conflicting users / groups versus access permissions.

    You can also compare with the security that is working on your other computer, see if it matches.

    If this fails. Take ownership of the whole drive. Add:

    Authenticated Users > Modify
    SYSTEM > Full Control
    Administrators > Full Control
    YourUserName > Full Control

    Apply and replace all inheritance.

    After this, your security setup should be correct... It probably already is... And something in Windows seams to be broken.

    Beyond this you can try to verify if there is no corrupted files in your installation.

    Sfc /scannow
    DISM /Online /Cleanup-Image /RestoreHealth

    And finally a Windows Refresh or In Place Upgrade should definitively fix it.

    Refresh Windows 10
    Repair Install Windows 10 with an In-place Upgrade

    Hope you get this sorted out before getting to this extend... Come back with anything you find that could help lead to a solution.
      My Computers


  7. Posts : 5,899
    Win 11 Pro (x64) 22H2
       #7

    @bteamstephen;

    I hate to ask, but did you click "Continue" in that notification? I've had instances where I'll get that box, then I hit Continue and it proceeds. Not always, but most of the time.

    Just double checking

    Outside of the above, I have no suggestions on your issue.
      My Computers


  8. Posts : 12
    Windows 10
    Thread Starter
       #8

    MaloK said:
    Open an administrative cmd prompt: pls post back windows replies.
    Code:
    Net user YourUserName
    Here are results from this step:
    Can't delete folders/files within a symbolic link or junction mklink-capture01.png
    Local Groups: Administrators, Users
    MaloK said:
    And verify your local group membership.

    Verify folder security on your target directory:
    Code:
    icacls F:\000MoviesHDD
    Verify If there is no conflicting users / groups versus access permissions.

    You can also compare with the security that is working on your other computer, see if it matches.
    Results from this step:
    Can't delete folders/files within a symbolic link or junction mklink-capture02.png
    I don't know what the different notes mean - (I) (OI) (CI) (F) etc

    Results from the laptop working correctly. For this I created a symlink to my Documents D:\ hard drive
    Can't delete folders/files within a symbolic link or junction mklink-capture03.jpg
    MaloK said:
    If this fails. Take ownership of the whole drive. Add:

    Authenticated Users > Modify
    SYSTEM > Full Control
    Administrators > Full Control
    YourUserName > Full Control

    Apply and replace all inheritance.

    After this, your security setup should be correct... It probably already is... And something in Windows seams to be broken.
    I had previously taken ownership with my user name "SMILLER" but I added "Authenticated Users" and "Administrators" to the list here:Can't delete folders/files within a symbolic link or junction mklink-capture04.jpg

    I also performed this step on the symlink folder F:\Movies that I created where my user name is the Owner and I added Administrators and Authenticated Users, also with no luck.
    MaloK said:
    Beyond this you can try to verify if there is no corrupted files in your installation.

    Sfc /scannow
    DISM /Online /Cleanup-Image /RestoreHealth
    I also tried this step with no luck. After all of these suggestions I am still getting this error when I try to delete a folder through the symlink:
    Can't delete folders/files within a symbolic link or junction mklink-capture05.jpg
    It still says I need permission from SMILLLER
    MaloK said:
    And finally a Windows Refresh or In Place Upgrade should definitively fix it.

    Refresh Windows 10
    Repair Install Windows 10 with an In-place Upgrade

    Hope you get this sorted out before getting to this extend... Come back with anything you find that could help lead to a solution.
    Thanks for all the suggestions. I would love to get your thoughts on the results above before resorting to a refresh or repair install of Windows. Both of those processes remove installed apps, yes?

    - - - Updated - - -

    sygnus21 said:
    @bteamstephen;

    I hate to ask, but did you click "Continue" in that notification? I've had instances where I'll get that box, then I hit Continue and it proceeds. Not always, but most of the time.

    Just double checking

    Outside of the above, I have no suggestions on your issue.
    I appreciate your response, as sometimes I may not see the clear answer right in front of my nose.

    When I click Continue, it still doesn't allow me to delete and says that I need permission from SMILLER, which is my user name:
    Can't delete folders/files within a symbolic link or junction mklink-capture05.jpgInterestingly, If I go inside the folder and delete the media file itself, it hangs for about 15 seconds and then it deletes. But then I go up one folder level and I still can't delete the containing folder.
      My Computer


  9. Posts : 2,800
    Windows 7 Pro
       #9

    Thanks for following.

    Can you also post a

    Code:
    icacls F:\
    From your problematic PC
      My Computers


  10. Posts : 12
    Windows 10
    Thread Starter
       #10

    MaloK said:
    Thanks for following.

    Can you also post a

    Code:
    icacls F:\
    From your problematic PC
    Sure, here you go:
    Can't delete folders/files within a symbolic link or junction mklink-capture.jpg
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 09:30.
Find Us




Windows 10 Forums