Adding File Templates
'm sure you know about the New menu. Right-click within any folder, click New, and choose one of the templates available to create a new, empty file; then double-click the new file to edit it. By default, Windows provides the following templates: Briefcase, Bitmap Image, Wordpad Document, Rich Text Document, Text Document, Wave Sound, and Compressed (Zipped Folder). You can add templates, though, making the chore of starting new files quicker and easier.
Adding new templates is a two-step process:
In the file extension key HKCR\.ext, create the ShellNew subkey.
Add one of the following four values to the ShellNew subkey to define how Windows creates new files of the .ext type:
This is an empty REG_SZ value. Windows creates a zero-length file. Make sure that the associated program can handle empty files.
This is a REG_SZ value that contains the name of a template file. By default, Windows looks in %UserProfile%\Templates for this file, but you can include an explicit path.
This is a REG_BINARY value containing a binary stream of data that Windows uses to create the new file.
This is a REG_SZ value. Windows executes the command in this value, passing it the path and name of the file it's to create.
For example, the template for the .txt file extension creates a null file. Double-click the file to edit it in Notepad. If you'd rather create the file and open it in Notepad automatically, remove the value NullFile from the key HKCR\.txt\ShellNew. Then add the value Command, and set it to Notepad.exe "%1". When you create a new text file using the New menu, Notepad starts and prompts you to choose whether you want it to create the new file. Ideally, any application you launch using the Command value would have a command-line option to suppress the prompt, but as most don't, you have no choice but to answer it.