Take the 2-minute tour ×

Vista allows files with empty "first name" (for example, ".svn"). However, when I try to remove the filename of an existing file, leaving the prefix, in Explorer or using cmd's 'rename', I fail. How can I easily rename files to include the suffix only?

(I use Vista, if that matters).

share|improve this question
add comment

5 Answers

up vote 15 down vote accepted

You can also do a file name that starts with a period, and has no extension. Try naming it ".whatever." (note the trailing period). This works in both Explorer and from the command line.

share|improve this answer
Usually Explorer insists that "You must type a file name". –  grawity Jun 9 '09 at 16:52
Not if you add the suffix . –  ripper234 Jun 10 '09 at 13:14
Wow! Cool trick. However... it doesn't make ANY SENSE that putting a dot at the end will both allow a "nameless" file and erase the ending dot. That makes me think that this is a BUG in explorer, and is a behavior that could possibly change in the future. It does work though, and this is a common problem with Unix tools that are ported to windows (Msys and Cygwin use dot-folders a lot, in addition to SVN and Git, as mentioned). So, should we be spreading this trick around, if it's likely to stop working? –  Jerph Dec 23 '09 at 16:38
add comment

rename filename.txt ".txt"

share|improve this answer
add comment

If you're looking at something called ".svn" more than likely you're really looking at a folder in which case "del" won't cut it. ".svn" is what TortoiseSVN (and maybe other SVN clients as well) calls its internal folders. There is an option to use an underscore character instead of a period. The "rename" command should still work fine on folders, though.

Other than that, standard cmd.exe commands should work just fine on "extension only" files.

del .abc
ren file.abc .abc
copy file.abc .abc
share|improve this answer
add comment

Same issue on Windows Server 2008.
Had a filed named 'keystore', needed it to be named '.keystore' .

  1. Rename file to '.keystore.txt' , the problem is this is not a text file and the '.txt' extension causes file not found problems.

  2. Open command prompt and use the move command to rename the file.

    move .keystore.txt .keystore

Now the file does not have the .txt extension and file type is recongized as KEYSTORE File.

share|improve this answer
add comment

From the command line:

>.foo echo #first line
notepad .foo
share|improve this answer
add comment

Your Answer


