It is very annoying to see the message with "the file cannot be deleted" when you try to get rid of the files you don't need anymore. In some cases, there are simple circumstances to avoid this kind of message or ways to manage easier the situation. But there are also situations where novices cannot handle the deletion of certain files. If this is your case, the best solution is to speak with a Windows expert who knows what is NTFS for example.
However, in this article are shown simple facts to avoid or be careful at. The actions are intended to give guidance for novices and experts as well.
The file in use could be open somewhere or it could be in the pending deletion status. To see all the files and running processes, open Start Task Manager and close from there the files by clicking End Task.
If you are struggling with a file system corruption, this prevents access to the file. In most cases, you are not able to delete the file if the file system is corrupted and the solution could be to run a Windows utility to solve this problem.
If you search for a file named " text.txt" and you didn't find it, probably is the case that you have used the space before that word. Thus, if your file is named "text.txt", you must use the file name exactly.
There are specific files with names reserved only for Windows operating system. To rename this kind of files, you can use a non-Win32 program.
You can take a look at the bar with open files where normally you can see all the files you are using at that moment. Close the file and try to delete it. If you still having issues, probably because that file is still in use, open the Task Manager. To see all your open files and processes, open Start Task Manager by pressing at the same time the [Ctrl]+[Alt]+[Del] keys.
It is an easier option to close a file that is not responding. After you view the list with files and processes, select the file you want to close and click on "End task".
Renaming of the files causing you troubles, it is one option for solving the deletion of those files. You must use a non-Win32 program, such as the POSIX tool that uses the appropriate internal syntax for those files. Probably these actions are intended for experts.
If a corrupted file into your system is preventing access to the file, you should run the Chkdsk utility on the disk volume to correct any errors after the checking of the bad sectors.
Solutions 1 and 3 are easy to do and you don't need to be a Windows expert to make these actions. Probably you have used before the Start Task Manager for viewing the performance of your system. In the same way, you can see and end a task that you don't want to run anymore. The Check Disk utility is well known (or it should be) for Windows users. It is recommended to run checking for your system frequently; in any case when some troubles occur. The second method for renaming the files requires a certain level of knowledge in the field of Informatics.