Problem:

I’m using Windows Server 2008 R2, and I created a project named “WPFMyWindow” by Visual Studio 2010. After some time I needed to delete that project, so I removed it from Visual Studio 2010. Then I navigated to the solution folder and found that the project folder still exists.

You need permission to perform this action

I selected that folder and hit “Delete” key, but a message box pop up saying:

You need permission to perform this action

Solution:

The folder you want to delete seemed to have been locked by Visual Studio 2010. Solution is:

Close Visual Studio 2010 first, and then try delete the folder again. Then the action should succeed.

 

In this situation, you need to take the ownership of the folder. Somehow the system consider that you are not the owner of this folder, so it prevented you from deleting this folder.

To take the ownership, you need:

  1. Right-click the folder, click Properties, and then click the Security tab.
  2. Click Advanced to open the Advanced Security Settings for <Object> dialog box.
  3. Click Owner tab, click Edit. If you are prompted for an administrator password or confirmation, type your password or click Continue.
  4. In the new Advanced Security Settings for <Object> box, in the Change owner to: field, select your User name, and Check the Replace owner on subcontainers and objects. Click OK, repeat for remaining boxes. (If your User name is not listed click the Other users or groups button to add your account).
  5. Open the directory containing the folder you wish to delete. Right-click the folder and delete it.

Remark

Thanks Ramifor providing this solution.