Idea: Hide Items From Right Click "New" Menu

With the addition of the very convenient feature to disable shell extensions, I was thinking it would be nice to be able to hide items from the "New" (aka 'Create File') menu when right clicking.

I know these items are added via the registry, but at least in the case of the Google Drive desktop app, if you remove the entries (such as SOFTWARE\Classes\.gdoc\ShellNew for the "Google Docs" item), it simply adds itself back. I even tried changing the permissions on that registry key so the program couldn't add it back, but soon realized that it checks every single minute whether the registry items are there, and when it can't it add them back it causes an annoying refresh of the desktop every time. Not sure if there's any other software that automatically adds itself back but I wouldn't be surprised.

Anyway I figured it might be a nice addition also for people who don't want to dig through the registry to remove entries. Perhaps even later even more functionality could be added to add custom items too.

3 Likes

Definitely makes sense!

At the moment, I tackle it the other way around, since I usually only want to create a small number of types. I hide the New menu entirely and make explicit items for the types I want.

E.g. FileType NEW=.txt

I finally got around to implementing that strategy and it's definitely the way to go. It basically works identically to the native one but allows a lot more customization:

Some tips for anyone finding this thread from searching Google or whatever:

  • It took me a bit of searching to find how to add the 'New' option to the context menu that comes up when right clicking the background, but you just have to go to the toolbar 'Customize' window just as if you're adding a new toolbar button, then the 'Context Menu' tab, then File Display background > Folders. This is as opposed to where you'd go to customize what happens right clicking files, which would be the File Types menu from my understanding.
  • This post is helpful in general
  • Taken from this thread, a cool thing you can do by using the Directory Opus 'New' menu instead of the native one is to have it immediately open the file in your editor of choice after creating the new file by using something like this below (In my case I use notepad++). I modified it slightly to leave out the dialogue box pop up function, because like this it still lets you just type to set the filename like normal, and only pops up the editor after you finalize the name anyway which is perfect.
    @nofilenamequoting
    FileType NEW=.bat
    "C:\Program Files\Notepad++\notepad++.exe" "{sourcepath}{$newfile}"
    
  • I added an entry to create a PowerShell script file, which isn't in the list of default File Types so you can't do NEW=.ps1, but since powershell script files are just raw text files anyway, you can just do this like is mentioned here:
    Filetype NEW=.txt NEWNAME="New PowerShell Script.ps1"
    And you can replace the default name with whatever. And note that the file still gets created with the default name highlighted so you can immediately start typing to choose a name anyway, I just set it to the same way windows natively creates new file names.
1 Like