0

When you right click in a folder you get an option to add a new file type such as .txt/.rtf I want to add a file without extension to this menu.

How do i add an extensionless file to the (windows 10) 'new' context menu?

Alex bries
  • 101
  • 3

1 Answers1

0

To create a default association for files with no extension, create a .reg file containing text similar to the following example, where notepad is defined as the handler:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.\shell\openwithnotepad]
@="Open with Notepad"

[HKEY_CLASSES_ROOT\.\shell\openwithnotepad\command]
@="c:\\windows\\notepad.exe \"%1\""

Substitute in the above your program, instead of notepad, then run the .reg file to enter this data into the registry (administrator permissions required).

If you now double-click on a file with no extension, it will open with your application.

Be careful to keep the \"%1\" parameter, and if the path to your program contains blanks, then enclose the whole path in quotes like this: \".

harrymc
  • 455,459
  • 31
  • 526
  • 924
  • I am trying to create the file from the windows right-click menu, not set a default program. I tried HKEY_CLASSES_ROOT\.\ShellNew and HKEY_CLASSES_ROOT\*\ShellNew, but that didn't work – Alex bries Aug 20 '21 at 13:33