Create/rename a file/folder that begins with a dot in Windows?

Many programs needs folder names that starts with a dot, like .emacs.d, .gimp-2.2, .jedit etc. How do I create such a folder?

When using the Windows Explorer in Windows 2000 (and other versions), I get an error message saying "You have to enter a filename". The only solution I have come up with, is to open a command prompt (Start > Run > "CMD" > OK) and enter mkdir .mydir.

Why have Microsoft this error message in the Explorer, but not in the command shell? Is there any registry hack out there to fix this, so that I am able to enter the folder name directly in the Explorer?


Solution 1:

To create/rename on windows explorer, just rename to .name. - The additional dot at the end is necessary, and will be removed by Windows Explorer.

To create a new file begins with a dot, on command prompt:

echo testing > .name

Solution 2:

You can create a folder using the Command Prompt with:

mkdir .foldername

You can create a file using command prompt with:

echo.>.filename.extension

Solution 3:

Good question. There is an easy way to do this from Windows Explorer without using a command prompt or shell. Suppose you want to create a folder called: ".apple"

  1. Create a New Folder from Windows Explorer as you normally would.
  2. When prompted to enter a name, type: ".apple." (notice the dot at the end)

Windows should create a folder called: ".apple"

Please note that I've used this only on Windows 7. I am not sure if other versions of Windows support this.

P.S. Chris Moschini says in a comment that it works in Windows 10.