How to delete a folder that name ended with a dot (".")? How to delete a folder that name ended with a dot (".")? windows windows

How to delete a folder that name ended with a dot (".")?


Here's a solution to this problem:

rd /s "\\?\C:\Documents and Settings\User\Desktop\Annoying Folder."


Solution:When you call RemoveDirectory, make sure that you prefix the path with the string "\\?\".


Explanation:It has everything to do with the dot. According to MSDN, there are certain cases where you may not be able to delete a file or folder on an NTFS volume, specifically when the file name is invalid in the Win32 name space (which is why you are unable to open the file using the normal methods in Windows Explorer).

You may not be able to delete a file if the file name includes an invalid name (for example, the file name has a trailing space or a trailing period or the file name is made up of a space only). To resolve this issue, use a tool that uses the appropriate internal syntax to delete the file. You can use the "\\?\" syntax with some tools to operate on these files, for example:
del "\\?\c:\path_to_file_that contains a trailing space.txt "
The cause of this issue is similar to Cause 4. However, if you use typical Win32 syntax to open a file that has trailing spaces or trailing periods in its name, the trailing spaces or periods are stripped before the actual file is opened. Therefore, if you have two files in the same folder named "AFile.txt" and "AFile.txt " (note the space after the file name), if you try to open the second file by using standard Win32 calls, you open the first file instead. Similarly, if you have a file whose name is just " " (a space character) and you try to open it by using standard Win32 calls, you open the file's parent folder instead. In this situation, if you try to change security settings on these files, you either may not be able to do this or you may unexpectedly change the settings on different files. If this behavior occurs, you may think that you have permission to a file that actually has a restrictive ACL.

(Source: http://support.microsoft.com/?kbid=320081)


Ive posted this on SU and I decided to post it here too. Its the simplest and fastest and easiest way to achieve this. I am now laughing at how much simple it is.

  1. Install WinRAR
  2. Follow the Step by Step procedure from pictures:
  3. enter image description here
  4. enter image description here
  5. enter image description here
  6. enter image description here

I myself had WinRaR installed so I decided to demonstrate the workaround in it.
This workaround is also possible by using 7zip.

One another thing I should mention is that, as it seems the problem is caused by using windows explorer and any other file browser (like winrar file browser itself, ftp explorers etc.) will treat this files as normal.
You could try using any file browser and simply delete those files and not bother archiving them though!Cheers!