How to Creating a New File Context Menu for Blank (No Extension) File or your own Custom File Extension

131 views Asked by At

I've been looking for a way to create files from the Right-Click > New Menu without an extension. The simple way has always been to create a new Text Document, Select All, & Rename it. but that makes it give you a confirmation dialog & adds an extra step. As I do this quite often that is a great inconvenience.

I have found 2 questions that seem to be asking a similar thing, but as marked as Closed without actually answering the question.

So I have pieced together a working method & I wanted to share it, but those questions can no longer be answered. So I will provide my answer with the question: "Is there a better way to do this?" as that can be answered if there's not a better way, or at the very least the information I have pieced together can be found by others looking for the same.

1

There are 1 answers

0
LostOnTheLine On

My Method

So to start we need to create a new extension. This is as easy as creating a New Text Document or editing a file you already have & changing the extension to something. For my use New Text File.blank was mine.

This alone won't add it to the Registry. To do this we need to click on the file & assign a program to open it. You must select Always Use This App to Open... for it to be added to the Registry. I use Notepad for this purpose, but anything is fine & it should not stick around after you are finished if you use the REG file.

Once we have done this there will be an entry in the registry for the extension

  • HKEY_CLASSES_ROOT\.blank

Now we just have to edit the registry to add this to the context menu &, if you so desire, allow it to create the new file without an extension.

Here's a REG file I edited to do this for me. You can create a New text file with something like add_new_blank_file.reg, so long as it ends in '.reg', & paste this code there.

Windows Registry Editor Version 5.00

; Created by: LostOnTheLine
; Created on: 2023-9-12
; Updated on: 2023-10-2


; Blank Document
[-HKEY_CLASSES_ROOT\.blank\ShellNew]
[HKEY_CLASSES_ROOT\.blank\ShellNew]

"NullFile"=""


[-HKEY_CLASSES_ROOT\.blank]

[HKEY_CLASSES_ROOT\.blank]
@="blankfile"
"Content Type"="text/plain"
"PerceivedType"="text"

[HKEY_CLASSES_ROOT\.blank\ShellNew]
"NullFile"=""

; This line makes it so that when the new file is created it does not have an extension
[HKEY_CLASSES_ROOT\.blank\ShellNew\Config]
"NoExtension"=""

[-HKEY_CLASSES_ROOT\SystemFileAssociations\.blank]

[HKEY_CLASSES_ROOT\SystemFileAssociations\.blank]
"PerceivedType"="document"

[-HKEY_CLASSES_ROOT\blankfile]

[HKEY_CLASSES_ROOT\blankfile]
@="Blank File"
"EditFlags"=dword:00210000


[-HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.blank]

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.blank\OpenWithList]

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.blank\OpenWithProgids]
"blankfile"=hex(0):

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.blank\UserChoice]
"Hash"="hyXk/CpboWw="
"ProgId"="blankfile"

[-HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\Roaming\OpenWith\FileExts\.blank]

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\Roaming\OpenWith\FileExts\.blank\UserChoice]
"Hash"="FvJcqeZpmOE="
"ProgId"="blankfile"

Now there's almost certainly things in there that aren't needed, like the EditFlags & ProgID, but I took this from a file designed to re-add the New Text Document entry if it was lost. As a new text document is 0kb file I just removed the things that I knew to be unnecessary & leave the rest. One addition I did that I did not include here was changing the default Icon for the .blank files. it can be done by adding this to the REG file

[HKEY_CLASSES_ROOT\blankfile\DefaultIcon]
@="C:\\Users\\Public\\Pictures\\Outline.ico"

Using your own ICO or DLL file or using one already built-in to windows however you see fit. But it will only show on files with the extension added, not the NoExtension files created by the Context Menu

This same method can be used without the [HKEY_CLASSES_ROOT\.blank\ShellNew\Config] "NoExtension"="" to make it create a new file with .blank from the context Menu.

If you would like the extension to be .myfeet you could replace every instance of .blank with .myfeet

Remove this from the REG file (.blank replaced with whatever extension you are using)

[HKEY_CLASSES_ROOT\.blank\ShellNew\Config]
"NoExtension"=""

If you want your file to be called Feet Maps replace every instance of blankfile with a ProgID you like but this I believe must have no spaces so something like feetmaps. Then replace

[HKEY_CLASSES_ROOT\blankfile]
@="Blank File"

with

[HKEY_CLASSES_ROOT\feetmaps]
@="Feet Maps"

Now when you create a new file in the context menu it will be called New Feet Maps.myfeet


Sources