开发者

Adding new filetypes to Windows 7's New context menu

I'm trying to add CSS, PHP, JS and HTML file types to the "New" right click menu in Windows 7. I know how to add the file types to the menu with ShellNew entries in the registry. But Windows doesn't give you any control ove开发者_JS百科r the display names of the new items - according to this the name's always taken from whatever application you've assigned to open the doc. I've set Notepad++ to open all of these file types, so I'm going to end up with several identical "Notepad++ document" entries in the menu, like this:

Adding new filetypes to Windows 7's New context menu

Does anybody know if there's a way out of this stupid situation without installing any tweak utilities?

Thanks all! Fred


To rename a context menu > new's item (in Windows 7, at least):

  1. Open regedit.
  2. Go to HKEY_CLASSES_ROOT\.%ext% and note the (Default) value. This is the file extension's ProdID.
  3. Go to HKEY_CLASSES_ROOT\%ProdID% (usually %ext%file) using the value obtained from step two. Set the (Default) value to whatever you would like the context menu new item to display as.
  4. Under HKEY_CLASSES_ROOT\%ProdID%, if there is a FriendlyTypeName value, rename it to FriendlyTypeName.old, as the (Default) value "is deprecated by the FriendlyTypeName entry"

I don't believe there is even a need to log out / restart, but if the changes don't take effect, log out and/or restart.


You could change the file type description for each file class manually.

  1. Look up the prog id under HKEY_CLASSES_ROOT\.%ext% (The default value)
  2. Under HKEY_CLASSES_ROOT\%progid%, set the default value and/or the "FriendlyTypeName" string to the string you want.

You might have to log off for it to take effect. You should probably stay away from the Chrome and Notepad++ file type/association dialogs so they don't overwrite your strings.

Both Chrome and Notepad++ are open source, you can create a patch for them that use better names for the file types. (What is a "Chrome HTML Document" anyway, HTML5 + extra chrome juice? =) )


I was able to derive a solution from the answers above.

  1. I replicated the particular application (JetBrains PHPStorm in my case) registry entry.

    PHPStorm2019.1 -> PHPStorm2019.1.scss, PHPStorm2019.1.js.

  2. Now I changed the Default REG_SZ of PHPStorm2019.1.scss to SCSS File and PHPStorm2019.1.js to JavaScript file.

  3. Mapped .scss and .js to PHPStorm2019.1.scss and PHPStorm2019.1.js respectively.

Adding new filetypes to Windows 7's New context menu

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜