Windows Server 2008 Server Core : Performing a Formatted Printout with Notepad
To locate such functionality, you must rely on the registry editor, RegEdit. To start this utility, type RegEdit at the command line and press Enter. At this point you need to look at the HKEY_ CLASSES_ROOT hive. Locate the extension of the file that you want to work with. The example uses the .txt entry shown in Figure 1. The (Default) entry shown in the right pane contains the essential information; the file association.
Figure 1. Locate the extension of the file you want to print from the command line.
Now that you know the file association, locate its entry in the registry. Figure 2 shows the entries for the txtfile association. The entry you want is the command for the print command shown highlighted in the figure. Notice that this command calls on Notepad with an undocumented /p command line switch to perform the printing. The %1 after the command line switch is the name of the file. Consequently, if you want to print a text file at the command line using Notepad, you simply type Notepad /p filename and press Enter.