How to create a file with a . dot prefix in Windows Explorer
If you right click in Windows and try to make a new text file with a . period/dot in front of it:
Name the file...something like .gitignore, for example.
You'll get the "You must type a file name" error.
But, rather than typing .gitignore, if you include an ending dot also, like
.gitignore.
Then it works fine.
Thanks, Mads, for the tip!
NOTE: We're assuming that you have "File name extensions" turned on, because if you don't, you're likely not a programmer. ;)
UPDATED: Mads has created an "Add Empty File" Extension for VS that makes it easy to create . files as well!
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9
I dare you...
My brain cast a LegacyClusterfuckException
Not sure if anyone is interested but I've been using a program Called Total Commander from ghisler.com for more years than I care to remember, even though I'm primarily a windows developer I barely touch windows explorer (still sour at microsoft for taking away the File Manager from windows 3.11 haha).
To create a file there it's SHIFT+F4 enter .test and it will put you in your fav text editor.
Recommend this to everyone that are keyboard and short-cut fans, if you love your mouse then it's probably not for you.
Brian.
Also this is a reason why it seems to work for @Peter DC, but under the hood it's not what you wanted. Nevertheless, great little tip.
M
Yes - I want "file without name"
No - Let me correct it
Brian,
+1 for Total Commander! I am using it for 10+ years and still rocks!
Great tip, though. Sometimes it's nice to just create the file and mess with it later.
Open a notepad and save the document, but surround the name with quotation marks, i.e. ".gitignore". You will get the same. You just have to navigate to the directory, but nothing that couldn't be handled by copy & paste.
http://www.microsoft.com/en-us/download/details.aspx?id=274
I do have one piece of feedback; the example pictures/text given isn't as clear as it could be. You change the target example text 1/2 way through the example (from .pooop to .gitignore). It would be more clear to the reader if .pooop was used throughout. This would remove a variable during the explanation and lead to a higher level of clarity. As it stands now, you have to read the text(teh horror) and examine the images to understand the solution. Really, the pictures could tell the whole tale if the example text was consistent.
I see this A LOT when reading examples of code on the internet, even printed in some books.
This is just nit-picky really, just wanted to throw it out there for you Scott!
@Scott, can you get Microsoft to include an "I am a developer" check-box on windows somewhere, they could allow this stuff to just happen!! They can turn off the "hide extensions" option by default too...
PK :-D
It's just one of those programs .....you never leave home without.
(gotta give Peter Norton credit for first addicting me...)
touch .bowerrc
Provided you have git installed.
Comments are closed.
Thanks Scott and Mads