4]-----------------------------------
3]THE SHELL GAME: A Continuing Column
3]System Printer Utilities
3]By Brad Webb
4]-----------------------------------

     This month you'll learn about installing printers and the CMD utility.
For some of the experimentation you'll need a CLI or Shell window. If you
know how to get either of these on screen, skip on to the start of the
tutorial. Otherwise, consider this:

3]IF YOU'RE NEW HERE
     The shell and the CLI are special windows. In these windows commands
and programs are run by typing, rather than by using the mouse and icons as
with the Workbench. The CLI is an older, more primitive version of the
shell. In this column we concentrate on the newer shell window. We examine
uses of the shell itself, utilities and programs you can run from the 
shell, and the shell's interactions with the familiar Workbench 
environment. This column provides tutorials and examples to make it easier
to follow.
     You will find a shell icon on your Workbench 1.3 disk in the window
that opens when you double-click on the disk icon. Double-click on the 
shell icon and you have a window in which you can type the exercises and
experiments from this column. If you plan to do the exercises while reading
this column, it's best you exit now, open a Shell window and return.
     If you have displayed this text by clicking on the ShellGame icon in
the J: window, toggle between the text and the Shell window by alternately
pressing ALT-N and ALT-M. Give it a try to see how easy it is. Please?
     Before working any exercises, be sure you have started your Amiga with
a copy of an unmodified Workbench disk.

3]DUAL PERSONALITY
     In recent columns we've explored the dual nature of the Amiga by
looking at the same commands and programs from both the Workbench and the
Shell. This month we continue that theme by looking at two printer control
programs from both environments. The programs are CMD and InstallPrinter.
Both are found in the Utilities drawer (directory) of the Workbench disk.

3]INSTALLING A NEW PRINTER DRIVER
     InstallPrinter is a utility provided for the first time with Workbench
1.3. When 1.3 was released the suite of Workbench programs had grown so
large it was difficult to include everything on one disk. Commodore's
solution was to move some items from the Workbench disk to the Extras disk.
Among the relocated items is the library of printer drivers. The
InstallPrinter program was provided to allow you to select the driver needed
for your particular needs and to move it to your Workbench disk. This
avoided a filled disk filling caused by having all the drivers on every
Workbench disk, when only one or two would be used by each owner.
     InstallPrinter is a script or "execute" file. It is a simple text file,
like a letter, but consisting of AmigaDOS commands. When used with the
Amiga's EXECUTE command, script files behave like a series of commands typed
at the keyboard. Script files are generally used from the Shell, but there
is a way to use them from the Workbench. When combined with a properly
prepared icon and the Amiga's command XICON, script files can be used from
the Workbench. Such an icon is provided for InstallPrinter in the Utilities
drawer.

3]SQUEEZING IN ANOTHER DRIVER
     Workbench disks are full beasts, but there is room for another printer
driver on them. We will work through some exercises showing how to use
InstallPrinter from both the Workbench and Shell to add drivers to your boot
disks. For these exercises be certain you have started your computer with a
copy of a standard Workbench 1.3 or 1.3.2 disk. Do NOT use your original
disk, in case something goes wrong. The instructions provided will work for
both single- and multiple-disk drive systems but owners with only one floppy
drive will have to do disk swapping when prompted.
     Open the Utilities drawer on your Workbench disk. Inside you will find
the icon for InstallPrinter. If you double-click on that icon, it will guide
you through the installation process. Go ahead and double-click on it. The
Amiga will ask you to put your Extras 1.3 disk in any drive. It will then
present you with a list of available printer drivers and ask you to enter
the name of one. Here's a copy of the list you will see.

 Alphacom_Alphapro_101            Brother_HR-15XL
 CalComp_ColorMaster              CalComp_ColorMaster2
 Canon_PJ-1080A                   CBM_MPS1000
 Diablo_630                       Diablo_Advantage_D25
 Diablo_C-150                     EpsonQ
 EpsonXOld                        EpsonX[CBM_MPS-1250]
 Howtek_Pixelmaster               HP_DeskJet
 HP_LaserJet                      HP_PaintJet
 HP_ThinkJet                      ImagewriterII
 Nec_Pinwriter                    Okidata_293I
 Okidata_92                       Okimate_20
 Quadram_QuadJet                  Qume_LetterPro_20
 Toshiba_P351C                    Toshiba_P351SX
 Xerox_4020     

     You must enter the name exactly as shown in the list. For our exercise
we will use the Diablo_630 printer driver. Enter the following:

     Diablo_630 <RETURN>

     InstallPrinter will copy the driver specified to the Workbench disk you
used to start your computer. You can then use the Preferences program as
described in the Amiga manual to select the new printer driver. I will
briefly describe the process below.

3]FROM THE SHELL
     You have just seen how to use InstallPrinter from the Workbench. Let's
see how to use it from the Shell. Make certain your Workbench disk is back
in drive df0:, then open a Shell window. Enter the following command, which
will remove the driver we just installed:
     
delete devs:printers/Diablo_630    <RETURN>

     At your Shell prompt type the following command:

execute sys:utilities/installprinter <RETURN>

     Once again the InstallPrinter program will run. Go ahead and use it to
install the Diablo_630 driver again, just for practice's sake. Then delete
it once again because I'm going to show you another way of installing
printer drivers. (Now you know why I picked a driver with a relatively short
name.)

3]USING AMIGADOS TO INSTALL PRINTER DRIVERS
     It isn't necessary to use the InstallPrinter program to make additional
printer drivers available. You can do the job quite easily with AmigaDOS.
There are very good reasons for knowing how to do so, as I will explain in a
moment.
     We use the AmigaDOS command COPY to add printer drivers to the
Workbench disk. We will copy the driver we want from the Extras 1.3 disk to
a specific location on the Workbench disk. Every Workbench disk has a
directory set aside just for printer drivers. Any driver we copy to this
directory will be available to the Preferences program. The "full pathname"
of the directory in question is Workbench1.3:devs/printers. Put your
Workbench disk in drive df0: and Extras 1.3 in df1: (if you have one). Type
the following command:

     copy "Extras 1.3:devs/printers/Diablo_630" to devs:printers/ <RETURN>

     Don't forget the quotes in the command above. They are needed because
of the space in Extras 1.3. If you are using only one floppy drive, you'll
be prompted for disk swaps as needed. Follow the on-screen prompts. The word
devs: in the command is AmigaDOS shorthand that means "the devs directory of
the disk used to start the computer." We are placing our copy in the devs
directory's subdirectory called printers. The Amiga's operating system
automatically looks for printer drivers in this directory.
     Once the copying is finished, double-click the Workbench 1.3 icon to
open the Workbench window, if not already open. Next, double-click on the
Preferences icon. In the Preferences window that opens, select the Change
Printer gadget by clicking on it. Use the up and down arrows in the printer
driver selection window and you should see the driver we just added among
those listed.
     To select the new driver, use the up and down arrows until the
drivername is highlighted in the center of the three lines. Click on the OK
gadget to return to the main Preferences screen. Click on the Save gadget to
make your selection permanent or on the Use gadget to have the selected
driver used for the current computing session.
     The InstallPrinter program works well, but as we just learned, it may
be just as easy to use the standard DOS COPY command. If you are unsure of
the exact name of the printer driver you require, or if you want to list all
the drivers available on your Extras 1.3 disk, the following command will
tell you. Be certain Workbench 1.3 is in df0: and then type:

dir "Extras 1.3:devs/printers" <RETURN> 

     You should see the following:

 Alphacom_Alphapro_101            Brother_HR-15XL
 CalComp_ColorMaster              CalComp_ColorMaster2
 Canon_PJ-1080A                   CBM_MPS1000
 Diablo_630                       Diablo_Advantage_D25
 Diablo_C-150                     EpsonQ
 EpsonXOld                        EpsonX[CBM_MPS-1250]
 Howtek_Pixelmaster               HP_DeskJet
 HP_LaserJet                      HP_PaintJet
 HP_ThinkJet                      ImagewriterII
 Nec_Pinwriter                    Okidata_293I
 Okidata_92                       Okimate_20
 Quadram_QuadJet                  Qume_LetterPro_20
 Toshiba_P351C                    Toshiba_P351SX
 Xerox_4020     

     There is another good reason for knowing how to install a new printer
driver with the AmigaDOS copy command rather than InstallPrinter. Not
all printer drivers that can be used by your Amiga are on the Extras 1.3
disk. There are commercial and public domain disks with additional drivers
on them. Most (if not all) must be installed with the COPY command rather
than InstallPrinter.

3]SOMETHING TO BEWARE
     All this discussion of printer drivers was started by a letter from a
reader. He wanted to know how to install a driver onto his copy of Deluxe
Print. I answered him and explained the methods outlined here, but I had to
issue a warning. You should know of this warning too.
     Not all programs use standard Amiga printer drivers. Some, like Deluxe
Print, use their own printer drivers. These printer drivers are almost never
compatible with any other programs. Furthermore, the standard Amiga printer
drivers will not work with these programs. It does no good to copy a
standard driver to such a program disk. If the program doesn't provide a
special driver for your printer, you are simply out of luck. This is one
reason most programs use the standard printer drivers. The programmers do
not have to worry about writing drivers for many different printers, and you
only need one driver for all the programs that use standard drivers. There
will probably always be a few programs out there that, for one reason or
another, rely on special drivers. The manuals that come with programs
usually warn you if they do not use standard drivers. If you have an unusual
printer, it is worth checking into every time you buy a program.

3]THE CMD PROGRAM 
     What do you do if you wish to use a printer attached to a different
Amiga than the one you are working on? Perhaps a friend has a laser printer
that he will let you use now and again. If he has the same software you do,
you can take your data files to his home and print them using his software,
-- or drag your software along. The CMD program was designed to make using
distant printers easier.
     CMD intercepts commands your software would ordinarily send to a
printer and writes them in a special file. Later, you can take the disk with
this file to your friend's computer, put it in his drive and COPY the file
to his printer. It will act just as if your computer and software were
driving it.
     How is this done? Like InstallPrinter, CMD can be used from both the
Workbench and the Shell. We'll explore both methods. You can perform most of
the following exercise even if you do not have access to a printer. I will
warn you when you should stop.
     One other very important item. Be sure you
 first use the Preferences program to activate the printer driver for
whatever printer will ultimately be doing the printing. If you have a
parallel port printer, set Preferences to Parallel printouts for the rest of
this experiment. Set it back to Serial before doing the COPY command shown
below.
     To use CMD from the Workbench, open the Workbench window and then the
Utilities drawer. Double-click on the CMD icon. The icon will remain
highlighted but nothing else will seem to happen. Now, we run a program and
obtain a printout. While the program thinks it is sending output to the
printer, the CMD program will actually be intercepting everything. This is
an excellent example of the Amiga's multitasking ability. CMD will create a
file in the RAM: disk called "CMD_file". It will look as if nothing is
happening until the "printout" is finished. Then CMD will pop up a small
window telling you how much data it sent to the CMD_file, then pop up
another small window telling you it is turning itself off.
     We will use the DOS command COPY for our experiment. Activate CMD from
the Workbench if you haven't already done so. In the Shell type:

copy s:startup-sequence to prt: <RETURN>

. . . "copy <something> to prt:" is the standard AmigaDOS way of printing a
text file from disk. The startup-sequence in the s: directory is a simple
text file. Now type the following command:

     dir ram: <RETURN>

You should see the file CMD_file listed. This is the file that contains all
the instructions COPY would ordinarily have sent to your printer. We must
now copy this file to something more substantial than the RAM: device. With
your Workbench disk back in drive df0: issue the command:

copy ram:CMD_file to diskname: <RETURN>

. . . where diskname is the name of a floppy disk with enough room to hold
the file.

3]WARNING - YOU MAY BE GETTING OFF HERE
     If you do not have access to a printer, do not perform the remainder
of this experiment. Otherwise, continue.
     Once the copying is complete, place Workbench back in drive df0: Now
issue one of the following commands, which you would ordinarily do on the
computer attached to the printer you wished to access.

copy diskname:CMD_file to par: <RETURN>

.. . or . . .

copy diskname:CMD_file to ser: <RETURN>

     Use the first command if the printer is attached to the computer's
parallel port and the second if it is attached to the serial port. Almost
all Amiga printers attach to the parallel, or Centronics, port.
     We use the PAR: or SER: devices rather than the more common PRT: device
for a very important reason. The PRT: device actually translates the output
of your program into specific codes for the particular printer called out by
your printer driver. CMD captures the information AFTER the translation. If
we used the PRT: device with the COPY command at this point, the information
would be translated twice and would probably not print at all.
     At this stage, your output should appear at the printer just as if your
program were actually driving it (the COPY command in our experiment). If it
didn't work, re-read the instructions above and have another go. 
     Those of you without any printer attached to your computers should be
able to use the method shown here to access a printer on a friend or
co-worker's computer, even if it's another brand. I haven't actually tried
it, but if the file CMD_file were copied to a floppy formatted for another
brand of computer and then copied to the printer port on that computer, it
should work just as well as when used on another Amiga. For example you
could use Dos-2-Dos from Central Coast software or Cross Dos from Consultron
to copy the CMD_file to an MS/DOS floppy. Placing that floppy in an MS/DOS
computer and COPYing or TYPE-ing it to the appropriate COM port should let
you print out on a printer attached to the MS/DOS machine.

3]FROM THE SHELL
     To use CMD from the shell, type:

run cmd parallel filename <RETURN>

. . . at a Shell prompt. If you have a serial printer you must change
parallel to serial in this example. You can use anything as "filename" (even
CMD_file for consistency's sake). Proceed as described above. CMD will
create the file FILENAME with your printer commands in it. Give it a try
with a different file, perhaps s:startupii.
     Note that we start the command with the word RUN so the current Shell
can still be used after CMD starts. We must tell CMD whether to redirect the
output of the parallel or serial port, and we must supply a filename for it
so save its output in.
     While we're at it, type this in your Shell window:

cmd ? <RETURN>
 
     Your Amiga will show you:

CLI Usage Cmd v6.00: [run] Cmd devicename filename [opt i s m n]
Type  cmd help  for more help

     This indicates there are options for the CMD command that we can use
from the Shell. To see more about the options, type:

cmd help <RETURN>

     CMD will respond:


CLI Usage Cmd v6.00: [run] Cmd devicename filename [opt i s m n]
  devicename = serial or parallel
  i = ignore any file that starts with 4 nulls
  s = SKIP any short initial write (usually a reset if screendump)
  m = installed for MULTIPLE files until Break or CTRL_C
  n = enables NOTIFY (helpful progress messages)

     WB Tooltypes: DEVICE, FILE, and booleans SKIP,MULTIPLE,NOTIFY

     The options work as follows:
     -- The i option causes CMD to ignore a class of file that would not
print correctly. If you use the m option to print several files in a row
using CMD, and one or more fails, try this option.
     -- The s option should be tried if there's trouble getting CMD to work
with screen dumps -- using a program that outputs a graphic representation
of the screen to your printer.
     -- The m option lets you use CMD for more than one file at a time.
     -- The n option causes CMD to keep you informed as to how it is
doing. We'll try an example using m and n ahead.
     The last line says you can use some of these options from Workbench.
You would single-click on the CMD icon, then use the "info" option of the
Workbench pulldown menu to gain access to the contents of the icon. Device
lets you change from parallel to serial. CMD ordinarily uses the parallel
port. File lets you change the name of the file from CMD_file.
     You could type SKIP, MULTIPLE or NOTIFY to activate the s, m or n
options. These would be added to the tool types area of the icon, and the
icon would be resaved. One item goes on each line and the up and down arrows
are used to cycle from one to another. The format is "device=serial",
"filename= CMDout", "skip (or multiple or notify)=true". Look at the
existing CMD icon for clarification.
     We won't go into an exercise of icon modification here, because these
options are much handier when used from the Shell. If you modify the icon,
you must change it each time you wish to change the options in use. Most of
the time, you will not want to use the options.

3]MULTIPLE FILES WITH CMD
     Let's see how to use CMD with more than one file. While we're at it,
we'll use the NOTIFY option to keep ourselves informed. In your shell type:

run cmd parallel ram:CMDout opt m n <RETURN>

     You will probably not get a prompt back after you press the RETURN key.
If not, press it again. When the prompt returns type:

copy s:startup-sequence to prt: <RETURN>

     You may have to press RETURN again to get a prompt. Now type:

copy s:startupii to prt: <RETURN>

     After each copy CMD tells you how much information it copied and what
the file name was. It made the first file CMDout.1 and automatically went to
.2 for the second. We could continue as long as we wished with this process.
Issue a "dir ram:" command to see your files.

     To remove CMD, type:

status <RETURN>

     STATUS will report one or several lines. One will look like:

Process 2: Loaded as command: cmd

     Make a note of the number (in our case 2). Type:

break 2 all <RETURN>

. . . substituting whatever process number CMD has in your computer.
     CMD will report by saying

Cmd redirection of parallel.device removed

     You can verify that with another STATUS command.

3]UNTIL NEXT MONTH...
     That's all for this month. I hope this look at InstallPrinter and
alternatives, and the CMD program will help you get more pleasure from an
Amiga and printer combination.
     A reader's questions triggered this column, and yours might provide the
impetus for a future one. If you have any topic you'd like to see me deal
with here, please write me:
     Brad Webb, 321 N. Monroe St., Watertown, WI 53094
     I'd be happy to hear from you.

4]END OF TEXT
