13

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).

voretaq7
  • 80,749
ripper234
  • 6,232

5 Answers5

29

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.

Joe Doyle
  • 1,691
2

rename filename.txt ".txt"

Kevin Kuphal
  • 9,194
1

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
squillman
  • 38,163
0

From the command line:

>.foo echo #first line
notepad .foo
0

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.

Mark
  • 754