I can't delete a directory inside a junctioned directory

0

So this is the deal. A couple of days ago I moved my profile folder C:\Documents and Settings\fmunoz to a different drive D:\fmunoz. Today, I created a directory in my desktop using the point-and-click method:

  • Right-click on an empty space in the desktop
  • Select New
  • Select Folder
  • Leave the default name New Folder and press Enter

I tried to delete the folder using the point-and-click method:

  • Right-click the New Folder directory
  • Select Delete

After five seconds, I got the following message:

---------------------------
Error Deleting File or Folder
---------------------------
Cannot delete New Folder: Access is denied.

Make sure the disk is not full or write-protected
and that the file is not currently in use.
---------------------------

Initially I thought that there must be some sort of indexing services locking the directory so I got a list of open files using the TuneUp Process Manager tool but the New Folder directory wasn't there.

I double-clicked My Computer, navigated to the desktop directory C:\Documents and Settings\fmunoz\Destkop, tried to delete the New Folder directory using the same point-and-click method described above and got exactly the same message at the same amount of time.

In the same window, I navigated to the actual location of the desktop directory D:\fmunoz\Desktop, tried to delete the New Folder directory and this time it worked.

I thought that this behavior was due to some special treatment that Windows gives to the desktop or the profile directories so I tried doing the same thing with a different set of directories:

  • Created a folder D:\dummy
  • Created a junction C:\dummy pointing to D:\dummy
  • Created a New Folder directory in C:\dummy
  • Tried to delete New Folder from C:\dummy. Didn't work.
  • Tried to delete New Folder from D:\dummy. It worked.

I tried creating the folder in the actual directory rather than the junction directory:

  • Created a New Folder directory in D:\dummy
  • Tried to delete New Folder from C:\dummy. Didn't work.
  • Tried to delete New Folder from D:\dummy. It worked.

I also tried using the Delete button instead of using the Delete option of the context menu but it didn't work.

When using the Shift+Delete sequence, it works. It also works by using the rd command in the console, but in both cases the deleted directory doesn't goes to the Recycle Bin, which is my intention when using the Delete context menu option or the Delete button.

Fredy Muñoz

Posted 2013-10-18T22:05:41.600

Reputation: 101

Try right clicking the file, select properties and then the security tab.Then select edit and make sure the account you're logged in with has "full" permissions. – Ben Plont – 2013-10-18T22:23:36.283

Thanks @ben-plont, I tried checking the security settings as you suggested and they seemed to be OK. I also tried to give Full Control permissions to the group Everyone but it didn't work. – Fredy Muñoz – 2013-10-21T15:37:12.050

Answers

1

I had the same problem with Windows XP when moved the "Documents and Settings" folder to another disk and made the Junction, to solve it I booted from one XP live CD and deleted the folders "RECYCLER" from the disk where the junction was created, I suppose C: where is Windows XP installed and D: where "Documents and Settings" was moved, then created a junction using:

rmdir /S C:\RECYCLER 
MKLINK /J C:\RECYCLER D:\RECYCLER 
attrib C:\RECYCLER +s +h

I Hope that can help you.

JB

jbolivarg

Posted 2013-10-18T22:05:41.600

Reputation: 11