Past few months, I had one problem which I always overlooked, thinking it will autocorrect. The problem was with a couple of old folders which even when I try to delete stay right there and refuse to get deleted. Funny part I remember deleting those folders. I have tried a lot of stuff directly from the registry to cleaning software and all failed. I finally took shelter with the good old command prompt to see if it works, and it did. If you are in the same situation, here is how to delete folders which refuse to delete.
How to delete folders which refuse to delete
To delete these type of folders, you need to make sure to remove everything inside the folder, and then delete it. Here we will use the Command Prompt to complete the operation.
1] Delete files inside that folder :
- If you do not have any file inside it, skip this step.
- Type CMD in your Windows Start Menu. You will see cmd.exe listed.
- Right click and start as administrator.
- Now navigate to the folder where this notorious folder is visible.
- Type the command dir/x to see the list of files. ( /x is used to see the full name)
- If you type in the full name after the del command, it doesn’t work.
- Note down the short name of the file is appears left to the full name. It will be in old windows format ~8.1*
- Type del short name of the folder.
- It will prompt that it will delete all the files inside it.
- Type Y. It will delete all the files from the folder.
2] Delete the folder :
RMDIR is the command which can delete any directory. Now I could have used it directly, but since it did not work when the files were in that folder, I chose to delete the files first.
- Now Type in RMDIR “shortname” of that folder.
- It will remove the folder now.
- In case it is still visible, reboot the computer, and it should be gone.
I hope this tip helped you to delete such folders from your computers. These ghost folders stay forever, and this old command works.