![]() | ::::::. ::/ \:::. :/___\::::. /| \:::::. :| _/\::::::. :| _|\ \:::::::. :::\_____\::::::::. ::::::::::::::::::::. ::::::::::::::::::::::. |
To this end I am including the set of instructions here as a supplement to the APJ issues; it covers the basics of setting up file associations, Send To... menu items, and New... menu items in the Explorer GUI.
Note: Any code samples headed by "REGEDIT 4", for example
are intended to be pasted into a reg file [e.g., a text file renamed to 1.reg] and
imported into the Registry either by double-clicking the reg file or by using the
Registry Editor [regedit.exe].
REGEDIT4
[HKEY_CLASSES_ROOT\.asm\ShellNew]
"NullFile"=""
Making Notepad a "Send To..." option
This is useful for quickly viewing files of any type in Notepad, simply by right-clicking on the file and choosing "Notepad" from the "Send To..." submenu. Additional programs [hex editors, disassemblers, compilers, debuggers] can be added in the same manner.
C:\Windows\SendTo
directory
C:\Windows\SendTo
will create cascaded "Send To..." submenus.
Associating .asm files with Notepad
This can be done through Explorer.exe, but you will learn more if you modify the registry directly. This will also serve as an introduction for later registry modification.
Note that HKEY_CLASSES_ROOT contains all of the file extensions and file types
recognized as important by the OS, and that "txtfile" is associated with Notepad
[see HKEY_CLASSES_ROOT\txtfile]. "@" stands for "default", as in the default value
for this registry key.
REGEDIT4
[HKEY_CLASSES_ROOT\.asm]
"Content Type"="text/plain"
@="txtfile"
[HKEY_CLASSES_ROOT\.asm\ShellNew]
"NullFile"=""
Creating a "DOS Prompt Here" Menu Item
While writing or testing console-mode programs it is very useful to be able to right-click on a directory icon in Explorer and select "DOS Prompt Here" from the context menu, thus opening a DOS box with the selected directory as the current directory. This feature was originally part of the Win95 Power Toys kit; for some reason it has never made it into the standard OS options.
REGEDIT4
[HKEY_CLASSES_ROOT\Folder\shell\DOS Prompt Here\command]
@="c:\windows\command.com -K cd %1"
Note that "Folder" is the object we are modifying [to encompass both "drive" and
"directory"], "shell" refers to the context menu, "DOS Prompt Here" is the item
we are adding to the context menu, and "command" is the command to be run when
that menu item is selected.
Creating a "New ASM File" MenuItem
This is very handy for creating .ASM file templates that you can open by right-clicking in a directory and selecting "ASM File" from the "New..." submenu.
First, put an asm template called asm.asm in the c:\windows\ShellNew
directory.
This is where all templates for the "New..." menu are stored.
REGEDIT4
[HKEY_CLASSES_ROOT\asmfile]
@="Assembly Program"
[HKEY_CLASSES_ROOT\asmfile\DefaultIcon]
@="C:\WINDOWS\SYSTEM\shell32.dll,-152"
[HKEY_CLASSES_ROOT\asmfile\shell]
[HKEY_CLASSES_ROOT\asmfile\shell\open]
[HKEY_CLASSES_ROOT\asmfile\shell\open\command]
@="C:\WINDOWS\NOTEPAD.EXE %1"
[HKEY_CLASSES_ROOT\asmfile\shell\print]
[HKEY_CLASSES_ROOT\asmfile\shell\print\command]
@="C:\WINDOWS\NOTEPAD.EXE /p %1"
What we have done here is to create a class similar to "txtfile" which contains
all of the necessary associations for .ASM files [open with "notepad", print with
"notepad /p"]. Now we must associate the .asm file extension with the "asmfile"
class, and make "asm.asm" the "New..." file:
REGEDIT4
[HKEY_CLASSES_ROOT\.asm]
"Content Type"="text/plain"
@="asmfile"
[HKEY_CLASSES_ROOT\.asm\ShellNew]
"NullFile"="asm.asm"