How do I manually create a file with a . (dot) prefix in Windows? For example, .htaccess

If you start Notepad and then File -> Save As -> Write .htaccess and choose "All Files" as the type - then it will create the .htaccess file for you.

Notepad save as .htaccess


Windows 7, 8 & 10

This is dead easy since Windows 7. In File Explorer, right click anywhere and create a new file. Type the new filename as .something. (notice the appended period) and press enter twice, job done.

Demonstrating how to create a file with no name in File Explorer.

So instead of being prompted with

You must type a file name.

You will instead be prompted with

If you change a file name extension, the file might become unusable.

Note: If you're having issues then please ensure you have "file name extensions" visible, you can activate this under the "View" menu in File Explorer. Also, this method works for folders too.


Within Notepad select File > Save As...

File name: ".whatever you want" (with the leading dot)

You can do it in Explorer (in Windows 7) by adding a period at the end of the filename:

.whatever you want.

Windows will automatically remove the trailing dot when you validate.