I'm on a Windows 7 machine and need to create a new folder whose name starts with a dot. To be specific, I need to create the folder "C:\USERS\theusername\.ec2" because that is the default location that the AWS plugin for Eclipse likes to find certain configuration files.

Windows 7 gives me an error message whenever I try to create a folder that starts with a dot:

You must type a filename

Seriously? There are already subfolders in this folder that start with a dot!

How can I tell Windows 7 to just shut up and create my folder?

  1. From the folder above the parent for the new folder, shift-right click on the parent, choose "Open command prompt here".

  2. Type mkdir .ec2 (enter)

  3. Close the command prompt

| improve this answer | |
  • 1
    This is what I have been doing but it just seemed wrong. At least now I know I'm not crazy. – Jim Tough Sep 5 '11 at 0:48
  • 1
    you can do the same without opening the command prompt by just typing the command into the directory bar (see my answer) skips 2 steps :) – Moak Aug 19 '14 at 16:34

This behavior is based on a "feature" of dos 8.3 where it was forbidden to have a file without a name.

Name the folder .name.

So the Explorer thinks you will create a file with a name but no extension(which is allowed). The explorer will then delete the dot at the end because it is unnecessary.

| improve this answer | |
  • 6
    This is a simple and very elegant solution! – Erik Schierboom May 31 '14 at 13:14
  • 3
    @erik-schierboom, I hope you are referring to this answer, rather than to the solution provided by Microsoft ;-) – R. Schreurs Apr 25 '16 at 14:42

From here.

To create/rename on windows explorer, just rename to .name.

The additional dot at the end is unnecessary, and will be removed by Windows Explorer.

In windows 8 (possibly 7) you can also type directly into the navigation bar "mkdir .name" without needing to open a command prompt

enter image description here

| improve this answer | |
  • Renaming inside windows explorer can still result in automatic changes to case, etc. Do you know if this is special handling for mkdir or whether other CMD.exe built-in commands work also? – Ben Voigt Aug 19 '14 at 16:36
  • all commands executed from the bar are as if launched from cmd.exe within that folder. example I can run a git command or composer update and it opens the window there and runs the command – Moak Aug 19 '14 at 16:38
  • 3
    You can type search terms into the navigation bar, and they might unintentionally get interpreted as commands? Am I missing something, or is that as disturbing as it sounds? – LarsH Aug 17 '16 at 18:30
  • @LarsH is that Windows 10 behavior? AFAIK 8 and lower did not have search in the navigation bar – Moak Aug 19 '16 at 13:59
  • in windows 7 just opens bing search – bluejayke Apr 7 at 13:04

One solution to this is:

  1. Start > Run > cmd > OK
  2. Enter:

    mkdir .yourfoldername
| improve this answer | |

Use the command line. Hold shift and right click in the directory you'd like to create a subdirectory in. Choose the "Open Command Prompt here" (or something like that) item. In it, type:

md .ec2
| improve this answer | |

You can do this from CMD. Navigate to where you need then

mkdir ".folder"
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.