A few times on Windows-10 I’ve had the case of a file or folder which can not be deleted. Trying to delete it gives the error-message “… is no longer located in …”. But clearly it is still there. Who you gonna believe, Windows or your own eyes? :-). You can not delete its containing folder either because it is not empty, and it can not be made empty because it contains files which can not be deleted. Who you gonna call?
Here’s the solution:
Open the command-prompt (NOT PowerShell) in the directory where you have the files or folders which can’t be deleted. Enter this command:
dir /x /a
The /a -option causes all files and folders including hidden ones to be listed. The /x option shows for each file or folder its legacy MS-DOS “8.3 name”.
Now that you know the MS-DOS names of the files, use those as argument to the DEL command. That should do the trick. Worked for me.
You might also need to open the command-prompt with “Run as administrator”.
