I like to experiment a lot with coding and creating html, css, js etc. files each time I want to try something is tiring. To get around this, I have created template html, css, etc. files and added them into "New" in context menu (How can I add an item to the 'new' context menu?).
Currently, I've added 4 items; html, css, js, and php. "New" submenu got a little crowded. Now I'm thinking if it's possible to create a new submenu with a custom name (e.g. "Coding") that I can add these files. Actual "New" submenu would be less crowded and I could access these coding files easily under a new submenu.
A second thought, this new submenu doesn't necessarily have to be just right in the context menu. It can be inside the "New" menu. I just want to group these four files.
Worst case scenario, can I reorder the "New" submenu? I'd like to stack these four at the top or at the bottom.
Update: I've created a repository for this functionality. Feel free to check it out.
Best Answer
I've been searching for a solution to this, but the closest thing I came up with to what I want is adding a new item to the context menu which calls a script that makes a copy of a template file.
This isn't really what I want, but this might give someone an idea, so I'll post this anyway.
First, I searched for a way to add an item to the context menu. For example, Command Prompt. Following registry key does the job.
Next, I want to add an item that creates a file, e.g., a CSS file.
Similar to Command Prompt registry key, this will add an item to the context-menu, but instead of running an application, it calls a bat file. Content of the bat file:
I have a
css.css
template file inC:\Windows\ShellNew
. I simply make a copy of the template file in the directory where I right click and chooseCascading Style Sheet Document
.Of course, I'll not use this method. This just complicates things even more. Imagine having all bat, css, html, js, and php files right in the context menu. I still need a better solution.
Update:
I may have found a solution. Original article: Add Cascading Menus for Programs in Desktop and My Computer Context Menus in Windows 7 and Later - AskVG
Adding the custom menu to the context-menu:
For this menu to work, we need to define these commands
cmd
,css
,html
, etc. For example, defining the Command Prompt:Clicking on Command Prompt on the menu will run
cmd.exe
. This is straightforward. Tricky part is adding an item/app that creates a new file.Let's start with a CSS file. Following registry will add the item to the menu.
While we have a new item with the name "Cascading Style Sheet Document", clicking on it, normally, wouldn't do anything. To make it create a new file in the current folder, we call a script.
I have prepared a batch script for each file type that I want to create;
bat.bat
,css.bat
,html.bat
, etc. and placed them inC:\Windows\CustomNew
. Also I have placed the template filesbat.bat
,css.css
,html.html
, etc. inC:\Windows\ShellNew
.So whenever I click "Cascading Style Sheet Document" on the menu, I call the
css.bat
which makes a copy of the css template file and places it in the current folder.css.bat
file:It'd be better just to create a new css file without calling any script, but I don't think that's possible. However, if anyone has an any idea, I'd love to hear it.
Look at it. It's beautiful :)