I can't delete a directory inside a junctioned directory

Posted by Fredy Muñoz on Super User See other posts from Super User or by Fredy Muñoz
Published on 2013-10-18T22:05:41Z Indexed on 2013/10/21 15:59 UTC
Read the original article Hit count: 223

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.

© Super User or respective owner

Related posts about windows-xp

Related posts about user-profiles