Windows Unable to Delete ._. File
Solution 1:
Run the following command (could require elevated privileges / open command prompt as administrator):
del "\\?\F:\._."
About the \\?\
prefix:
For file I/O, the "
\\?\
" prefix to a path string tells the Windows APIs to disable all string parsing and to send the string that follows it straight to the file system....
Because it turns off automatic expansion of the path string, the "
\\?\
" prefix also allows the use of "..
" and ".
" in the path names, which can be useful if you are attempting to perform operations on a file with these otherwise reserved relative path specifiers as part of the fully qualified path.
Note that you cannot use the "\\?\
" prefix with a relative path.
Example:
==> set prog>"\\?\D:\bat\Unusual Names\._."
==> dir "D:\bat\Unusual Names\*"|find "._."
08.11.2015 13:25 132 ._.
==> type "D:\bat\Unusual Names\._."
The system cannot find the file specified.
==> type "\\?\D:\bat\Unusual Names\._."
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
==> del "D:\bat\Unusual Names\._."
Could Not Find D:\bat\Unusual Names\._.
==> del "\\?\D:\bat\Unusual Names\._."
==> dir "D:\bat\Unusual Names\*"|find "._."
==>
Solution 2:
Even though the question has already been answered, I'd still like to offer a possible alternative solution: using the legacy "short names" (which you can display with the "/x" option to the dir command) can also allow you to get a grip on files with "funky" names that you can't handle otherwise:
C:\temp\test>dir
Volume in drive C has no label.
Volume Serial Number is 887A-5E48
Directory of C:\temp\test
11.11.2015 16:31 <DIR> .
11.11.2015 16:31 <DIR> ..
11.11.2015 16:31 7 ._.
1 File(s) 7 bytes
2 Dir(s) 44.966.129.664 bytes free
C:\temp\test>dir /x
Volume in drive C has no label.
Volume Serial Number is 887A-5E48
Directory of C:\temp\test
11.11.2015 16:31 <DIR> .
11.11.2015 16:31 <DIR> ..
11.11.2015 16:31 7 _3E35~1 ._.
1 File(s) 7 bytes
2 Dir(s) 44.966.129.664 bytes free
C:\temp\test>del _3e35~1
C:\temp\test>dir
Volume in drive C has no label.
Volume Serial Number is 887A-5E48
Directory of C:\temp\test
11.11.2015 16:31 <DIR> .
11.11.2015 16:31 <DIR> ..
0 File(s) 0 bytes
2 Dir(s) 44.966.129.664 bytes free
Solution 3:
Install 7-zip, open it and use its file menu to rename the file to a normal name (for instance to aaa
) and then you can delete it. Found at this post.
I tested this on Windows XP running in a VM. I used Linux to create a file called ._.
on a shared directory.