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?
512 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 17 You can create a folder using the Command Prompt with:
mkdir .foldername
You can create a file using command prompt with:
echo.>.filename.extension
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"
- Create a New Folder from Windows Explorer as you normally would.
- 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.
3Use 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.
Open a Command Prompt window and enter the following commands:
cd /path/to/the/file
ren file.extension .file.extensionThat worked for me.
You can do it with powershell cmdlet New-Item.
Open PowerShell console and enter
For File:
New-Item .whatever -type fileFor Folder:
New-Item .whatever -type directory 1 Total Commander does it in visual manner.
0Use 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.
1I couldn't create .bowerrc. So
First, I created bowerrc Then, to a dos prompt I said:
>powershell
PS > ren bowerrc .bowerrc
PS > exit
> 1 My favorite way to do this: I have ConEmu installed and integrated into the Windows context menu.
When I need to rename a file to one with the dot I choose "ConEmu here" from the context menu, then type:
ren name .nameCan also be used with echo method above.
Benefits:
- Quick and easy, doesn't take you out of context too much.
- No need to type
D: enter cd D:\\____\\_____\\_______\\____ - No need to install software you wouldn't otherwise (I like and use ConEmu for various purposes).
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.
1Windows (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.
3