- 13 Aug. 2003 - 09:21:
New Trick - Make new files with starting template
I've been wondering how they do it, and I finally figured it out.
Now I can create a new file from the new menu, and it will start off containing data of my choosing. This means code files can start with headers, image fiels can start with water marks, and files that can't start with zero bytes can now be used.
It's a two part edit: registry and file.
In the registry, under the extention you need to create a new key with the control it points to. For example: a .bat (batch file) has the text "batfile" in a text string. There is a matching key that tells windows what to do with that file. The new key would have to be under .bat and labeled "batfile" to work. Next you need yet another subkey called "ShellNew". In there you create a text string called "newfile" and a value of the file name of the template you want.
The second half is simple. Create a template file and place it in the hidden
Now when you open the new submenu you can create (going with the eample) a new batch file with all the basic info one usually would need to redundantly type pre-existing.
Here is the registry key info:
Below is the code for a batch file installer to make the reg change and starter batch file.