Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
Maybe you should try posting this on superuser.com –  Jonas B Nov 2 '09 at 15:18
    
This is an ancient protection built into windows explorer and dates back to the time that only DOS 8.3 filenames were available (Win 3.1) and files with just an extension were not allowed. Microsoft never bothered to remove this from the Explorer, probably because humans using the Explorer should be "protected" from accidentally creating files without a filename (i.e., only extension). –  Abel Nov 2 '09 at 15:22
9  
See also "How do I rename a file to .htaccess in Windows 7?" at superuser.com/questions/56562/… –  Arjan Nov 2 '09 at 15:30
add comment

migrated from stackoverflow.com Nov 2 '09 at 15:26

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

9 Answers

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
share|improve this answer
4  
I just tried .name. in Windows (XP) and it did not work; it complained about needing a filename. –  Synetech Jun 24 '12 at 16:54
15  
Confirmed to work on Windows 7. That's awesome. –  Joe White Jun 30 '12 at 21:26
9  
Confirmed to work on Windows 8. –  Mr. Polywhirl Jan 24 '13 at 3:38
1  
Only option to create in XP is thru command prompt. say mkdir .name –  Antony Thomas May 8 '13 at 18:05
1  
works on Windows 7 x64. Awesome trick, thank you –  Odys Jul 7 '13 at 15:16
show 4 more comments

You can create a folder using the Command Prompt with:

mkdir .foldername

You can create a file using command prompt with:

echo.>.filename.extension

share|improve this answer
add comment

Use any file browser other than Explorer (Shell). I have tested with WinRAR, 7-Zip ect. For example, open WinRAR, then navigate to your files or folders, click on it, press F2 (rename), put a . at beginning, Done! I have tested with both WinRAR and 7-Zip. You don't need to add to Zip or make a compressed file.

The simpler method I found in other answer, just put a . at the end too.

share|improve this answer
add comment

Windows (Explorer) does not allow you to create a folder that starts with a dot ('.'). This is for security/exploit reasons. However, it is possible (as you noted) to create the folder manually using the Command Prompt.

So, if your question was how to do it in native Windows Explorer, the answer is no -- You cannot.

share|improve this answer
1  
How do you do it from the command line? –  Buttons840 Nov 16 '11 at 20:13
6  
> Windows (Explorer) does not allow you to create a folder that starts with a dot ('.'). This is for security/exploit reasons. Huh? In what way? –  Synetech Jun 24 '12 at 16:55
1  
I second Synetech comment - if it is for "security/exploit reasons" then we need to call up Linus Torvald ASAP and tell him to plug this hole yesterday! –  Nathan Adams Oct 12 '12 at 2:56
    
bollocks....... –  David דוד Jun 25 '13 at 10:36
add comment

Total Commander does it in visual manner.

share|improve this answer
add comment

Use Windows Powershell. Otherwise this is not possible with DOS/Explorer - only method is to create foo.bar and then rename with the explorer window.

With Powershell you can

touch .bak

successfully.

share|improve this answer
add comment

Just download Anyclient and Fast Folder Rename. Fast folder rename will name a folder .whatever, using the replace feature. Anyclient will upload the folder and show it, even though it operates on a Windows system.

share|improve this answer
1  
links to the utilities would be very useful –  Jhonny D. Cano -Leftware- Aug 11 '11 at 17:14
add comment

Open a Command Prompt window and enter the following commands:

cd /path/to/the/file
ren file.extension .file.extension

That worked for me.

share|improve this answer
add comment

You can do it with powershell cmdlet New-Item.

Open PowerShell console and enter

For File: New-Item .whatever -type file

For Folder: New-Item .whatever -type directory

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.