Sometimes when deleting a folder first the UAC fires up and you’re asked to continue. Then the user is prompted “Cannot delete Folder: It is being used by another person. Close any programs that might be using the file and try again”. Of course other prompts you might see include:
- “Cannot delete file: Access is denied”
- “There has been a sharing violation”
- “The source or destination file may be in use”
- “The file is in use by another program or user”
- “Make sure the disk is not full or write-protected and that the file is not currently in use”
First let’s figure out the Problem:
Let’s say you have the main folder named ‘folder1‘, and in it there’s another folder aka ‘folder2‘. You try to delete folder1 but an Access Denied prompt is loaded. What should I do? There are three solutions..
- The Simple Solution
- The Slow Solution (but easy)
- The Fast Solution (but technical)… after the break…
Now the Solution 1: The Simple Solution…
Most of the time, this happens because there is another folder in the folder you’re trying to delete. So to delete folder1
- open folder1
- delete folder2
- delete folder1
This works fine. But if you many folders with multiple sub folders… then it’s a big problem… cause to open each folder and each and every folder in it… it’s one hell of a nightmare…
So here comes Solution 2: The Slow Solution…
As the title implies, this is another solution… but the more folders you have, the slower it gets. Next are the steps:
- Go to folder1, right click and choose properties
- Click the ‘Security’ tab
- Click ‘Edit’ to change permissions
- Another windows is loaded… click ‘Add’
- Enter your username and click ‘Check Names’
- Click ‘Ok’
- Set any extra permissions you need (by clicking the checkboxes)
- Click ‘Ok’
You now have permission on all the folders in the folder on which you clicked to view properties. But if you have many folders, it will take a long time… if so check solution 3.
Solution 3: The Fast Solution…
This solution is very fast but is a bit technical as well… cause you need to use the command prompt (cmd) to use this solution. You need to have administrative rights to do this in cmd… so in the search box when clicking start, enter command prompt… the search finds it… but instead of clicking on command prompt… right click and select ‘Run As Administrator’.
Now enter the following text in command prompt:
- takeown /f full_path_to_directory /r /d y
To set security access enter the next text as well, which will grant access to administrators role
- icacls full_path_to_directory /grant administrators:F /t
If you are not in the administrator role or you still can’t delete files, enter the next command:
- icacls full_path_to_directory /grant your_username:F /t
If you’re not comfortable with using command prompt, it’s better if you use solution 2… it might be slow but it’s surely easier and user friendly. If you have any other questions… just write them down! 😉
I like this way. This trick is good for users who love to play with technical ways. However, I have used Long Path Tool in this situation and it helped me easily and quickly. So this tool is best for those members who don’t love to play with technical skills.
Is it anything similar to the Long Path Tool from pathtoodeep.com? I would really like to give these types of tools a try coz I’m not really a computer person (if you know wjhat I mean). I read a lot of great reviews about it. Any information? :)\
Try this “LongPathTool” tried and tested.Guaranteed fix. Here you can rename, delete, open and move your files instantly without the worries of error messages saying that there is some sort of a problem.
I know this is an old post, but it’s the most relevant I’ve found on the subject. One other thing to note: depending on the version of windows, if a program has the file open it can still give you the access denied even after all these steps.