diff --git a/CustomNew/install.reg b/CustomNew/install.reg index 550e3d9..c865665 100644 Binary files a/CustomNew/install.reg and b/CustomNew/install.reg differ diff --git a/README.md b/README.md index 4699dd2..76f6bd6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ + # Custom "New" Menu A custom "New" submenu on the context menu. @@ -13,3 +14,53 @@ For more information, you can check this [question](https://superuser.com/questi ## Installation You need to copy `CustomNew` folder to your `Windows` directory (e.g. `C:\Windows`). Then run `install.reg` that's inside the CustomNew folder. If you're familiar with Registry Keys and Batch files, you can modify the submenu to meet your needs. + +## Customization + +Is possible to add/remove/change standard files and standard IDE or Editors. +Example of template file: +I want to add CPP standard file, so first of all we need to edit `"SubCommands"="npp;cmd;css;html;html-canvas;html-js;js;php;php-class;htaccess;py;reg;bat;ps1;vbs"` and add `;cpp` where you want, just remember that the position will be reflected in the context menu. +Now is time to create new key, here an example: + + [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\cpp] + @="C++ File" + ;You can delete row below if you not desire an icon. + "Icon"="C:\\Program Files\\Notepad++\\notepad++.exe,0" + ;Uncomment the line below if you want a separator above the contextmenuitem + ;"CommandFlags"=dword:00000020 + + [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\cpp\command] + @="C:\\Windows\\CustomNew\\scripts\\cpp.bat" + +Now create `cpp.bat` in scripts folder and paste it: + + @echo off + + setlocal enabledelayedexpansion + + ;Below template file, just edit with your kind of file. + set "template=cpp" + set "extension=cpp" + set "def=New Cpp File" + + set "name=%def%.%extension%" + set count=1 + + copy C:\Windows\CustomNew\templates\%template%.%extension% "%cd%" + + :loop + if not exist "%name%" goto :continue + set /a count+=1 + set "name=%def% (%count%).%extension%" + goto :loop + + :continue + rename "%template%.%extension%" "%name%" + +Now go to template folder and create `cpp.cpp`. +Install.reg is now complete, is time to edit uninstall.reg. +Edit uninstall.reg and add it at the end: + + [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\cpp] +Finish. Just repeat this procedure with all kind of file you want inside like `.cs` `.hpp` `.java` and other. + \ No newline at end of file