Skip to content

Instantly share code, notes, and snippets.

@ozh
Last active June 23, 2026 09:34
Show Gist options
  • Select an option

  • Save ozh/4131243 to your computer and use it in GitHub Desktop.

Select an option

Save ozh/4131243 to your computer and use it in GitHub Desktop.
Create dot files/directories (ie .file) on Windows

How to create a .file or .folder on Windows

There are several ways

1. Rename

  • Create file.txt
  • Rename to .file., the last dot will be dropped, you'll have .file

Works the same with a file or a directory.

2. Command line

File : echo > .name
Directory : mkdir .foldername

3. With Notepad

  • Create a new text document and edit with Notepad
  • When saving, enter .file as a name and select All files (*.*) as file type
@garbinmarcelo

Copy link
Copy Markdown

@RahulSDeshpande

Copy link
Copy Markdown

Good one, thanks :)

@Subfire

Subfire commented Dec 5, 2017

Copy link
Copy Markdown

how to create a file that file name end with one dot? and two dot?

@chanchal19

Copy link
Copy Markdown

it shows
you must type a correct folder name

@NGhebreial

Copy link
Copy Markdown

Thanks a lot!
Windows causes me headache...

@Freelix

Freelix commented Apr 19, 2018

Copy link
Copy Markdown

Thank you, really helpful !

@Dlaiven

Dlaiven commented May 25, 2018

Copy link
Copy Markdown

Thank you!

@akaban01

Copy link
Copy Markdown

cmd worked for me, thank you!

@whereisaaron

Copy link
Copy Markdown

Thanks! Love number (1): Microsoft developer makes dumb decision (making Windows Explorer validation broken for dot files that NTFS actually supports), compounds with dumb bug that defeats original dumb validation decision.

Take pride in your work, and do work you can be proud of.

Why this is still not fixed in Windows 10 1803 I can't imagine.

@jgs03177

jgs03177 commented Nov 6, 2018

Copy link
Copy Markdown

Thanks!

@lipeng1a

Copy link
Copy Markdown

Thank you! I make it.

@Zhanwei-Liu

Copy link
Copy Markdown

Thank you!

@Akashdhas

Copy link
Copy Markdown

thanks boss

@yingmonster123

Copy link
Copy Markdown

nice!

@Rynex-te

Rynex-te commented Dec 2, 2024

Copy link
Copy Markdown

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment