This question already has an answer here:

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?

marked as duplicate by Sathyajith Bhat Mar 11 '13 at 7:33

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

migrated from stackoverflow.com Sep 5 '11 at 0:46

This question came from our site for professional and enthusiast programmers.

up vote 43 down vote accepted
  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

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

  • 4
    This is a simple and very elegant solution! – Erik Schierboom May 31 '14 at 13:14
  • 2
    @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

  • 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
  • 2
    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

One solution to this is:

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

    mkdir .yourfoldername
    

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

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

mkdir ".folder"

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