Sometimes when users on a Mac manipulate files on a Windows network share, files get left with missing attributes where there is no security tab in the properties, you cannot take ownership of the files nor can you delete them and you get an error message that states “Cannot delete file: Cannot read from the source file or disk.”.
The reason is more than likely because the file or folder name ends with a dot, which isn’t allowed in Windows. If you work with them enough you will notice that Macs create all sorts of annoying hidden files usually starting with dot underscore such as “._DSStore”.
For a more detailed explanation of this, this blog is where I found the answer on how to force delete these items from the command prompt.
To force delete a file:
To force delete a directory:
rd /s "\\?\C:\PathToYourStubbornDirectory\BadFolderName."
If neither of these commands work for you, I have found another workaround for some of those pesky problematic files or directories. Don’t ask me why this works (if I had to guess, I would say it has something to do with invalid characters in a filename), but using 7-Zip, you can right click on a troublesome file or folder and “Add to archive…” while checking the “Delete files after compression” option to get rid of them. I was not able to find any other way to do it from the command line or even with Unlocker. Bizarre indeed.