Add to 'New' in the Context Menu
Add more options inside of your context menu under 'New'; want to easily make a .bat or .reg file without needing to go through the process of renaming? Now you can...
To get started on the process of adding these files to the context menu, you need to open up the registry editor and make your way to HKEY_CLASSES_ROOT
Once you do, you can right click on HKEY_CLASSES_ROOT and select 'new' and then choose 'Key' from that list and then name an extension of your choosing such as .reg, .cmd, .bat. However, with these being common extensions it is likely created already so scroll down until you find them.
Setting up .bat
I'll be choosing .bat for demonstration purposes. But ideally you can do this with any sort of file extension.
Once you get to the desired location, right click on the folder and select 'new' then 'Key' (see above picture) and name it exactly as shown ShellNew (see picture below)
After ShellNew is created, you want to right click while having it selected and create a 'String Value' and then name it NullFile
Congrats, you're finished! This tells Windows to create the file completely empty; if this is all you need, it should show immediately in your context menu under 'new' (if not, restart pc or reset file explorer through task manager)
But if you would like to customize these files even further you can do so below
Advanced/Optional
Steps to do so (showcasing .bat and .reg only)
.reg
- Right Click on desktop, and create a .reg file named template.reg and paste this text inside-> Windows Registry Editor Version 5.00 then hit 'ctrl s' to save and open your file explorer
- Once File Explorer is open, navigate to the root of your C drive ('C:\'), then go into Windows and create (or enter) a file called ShellNew (will likely prompt for admin if creating)
- You'll use this location for all template files that you use; grab the template.reg that you made earlier and put it in here.
- Now open the registry editor and navigate to this location, HKEY_CLASSES_ROOT\.reg\ShellNew where you want to right click and make a string value called FileName
- Once created, paste this value C:\Windows\ShellNew\template.reg (this should be the proper value given instructions were properly followed)
- Lastly, if you have another string key in there called NullFile it needs to be deleted, that string is only used when you want a completely blank document.
- Reboot isn't required but always nice to do.
.bat
- Right Click on desktop, and create a .bat file named template.bat and paste this text inside-> @echo off then hit 'ctrl s' to save and open your file explorer
- Once File Explorer is open, navigate to the root of your C drive ('C:\'), then go into Windows and create (or enter) a file called ShellNew (will likely prompt for admin if creating)
- You'll use this location for all template files that you use; grab the template.bat that you made earlier and put it in here.
- Now open the registry editor and navigate to this location, HKEY_CLASSES_ROOT\.bat\ShellNew where you want to right click and make a string value called FileName
- Once created, paste this value C:\Windows\ShellNew\template.bat (this should be the proper value given instructions were properly followed)
- Lastly, if you have another string key in there called NullFile it needs to be deleted, that string is only used when you want a completely blank document.
- Reboot isn't required but always nice to do.
You should in theory be able to follow this same sort of formatting for most code related file extensions.