49

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?

Oliver Salzburg
  • 86,445
  • 63
  • 260
  • 306
Jim Tough
  • 678
  • 1
  • 7
  • 12

6 Answers6

57

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.

Oliver Salzburg
  • 86,445
  • 63
  • 260
  • 306
Ankou
  • 571
  • 4
  • 2
46
  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

Ben Voigt
  • 7,204
  • 3
  • 37
  • 58
  • 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 05 '11 at 00: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
7

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

Moak
  • 681
  • 3
  • 10
  • 23
  • 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 – B''H Bi'ezras -- Boruch Hashem Apr 07 '20 at 13:04
1

One solution to this is:

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

    mkdir .yourfoldername
    
zants
  • 135
  • 1
  • 2
  • 11
0

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
0

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

mkdir ".folder"
Starx
  • 2,271
  • 5
  • 30
  • 37