|Dͻ
|D |5The Happy Hacker |D
|Dͼ

^C|0
^C|0|E~0Bits 'N PC's ^0|0
^C|0|F~0      by     ^0|0
^C|0|F~0Daniel Tobias^0|0
^C|0

This is a column of hints, tips, and advice for PC users.

^C|5
^C|5~3|0CREATING SHORT TEXT FILES^0|5
^C|5

If you ever need to create a short text file, like a batch file, or data for a
program, then there is an easy way to do it without any text editor.  Just
type (from the DOS prompt):  ^1COPY CON filename^0  where "filename" is the name
of the file you wish to create.  Then type the text of the file, ending with a
^I CTRL ^N-Z followed by a ^I RETURN ^N.  Be careful to type correctly; once you have
ended a line with the ^I RETURN ^N key, you can't go back and edit previous lines,
although you can correct errors on the current line with the backspace key.


^C|5
^C|5~3|0INFORMATIVE PROMPTS FOR HARD DISK USERS^0|5
^C|5

Normally, DOS will prompt you for a command with a letter and an angle
bracket, like ^1A>^0.  This lets you know which disk drive is currently used
as the default.  However, for hard disk users, this is usually not enough
information; you probably have lots of subdirectories, and you might forget
which one you are in.  There is a way to get DOS to show this information in
its prompt.  Use the following command:

                          ^1prompt $p$g

This should be placed in your AUTOEXEC.BAT file, so it is invoked every time
you boot the system.  This causes the current drive and directory to be shown
in the prompt.

Various other things, such as the current time and date, can also be placed in
your prompt string; consult your DOS manual for more information.

One caution:  if you set the current drive to a floppy disk drive, then remove
the disk, and enter a DOS command while no disk is in the drive, even if the
command does not cause a disk access; the next time DOS tries to output a
prompt, it will be unable to find the current subdirectory of the floppy disk,
which will produce an error condition, and give you the infamous "Abort, Retry,
Ignore?" prompt.  If you select Abort, DOS will return to command level;
unfortunately, this entails giving a prompt again, which will put it right back
into the error state.

The best recourse is to insert any MS-DOS formatted disk in the drive and
select the "Retry" option.  If no disk is handy, use the "Ignore" option; it
brings you to command level without any disk access.  However, you will get
unpredictable values for current drive and path in the prompt after doing this.

To avoid such problems, set the current drive back to the hard disk before
removing the floppy disk you were working with, unless you are planning to
insert another floppy disk right away.  Never leave the currently-selected
drive empty.

^C|5
^C|5~3|0TAKING THE RIGHT PATH^0|5
^C|5

MS-DOS has two kinds of commands, internal and external.  The internal
commands are part of the DOS that is resident in memory; you can invoke them
at any time without any disk access.  For example, ^1DIR^0 is an internal command.
External commands are stored in files with a .COM or an .EXE extension, and
must be loaded from disk when they are invoked.  ^1CHKDSK^0 and ^1FORMAT^0 are
external commands.  You can also write your own programs in a variety of
languages which compile or assemble into a .COM or .EXE file, or write batch
files with a .BAT extension.  These can all be invoked just like DOS external
commands by typing their names.

However, if you have a hard disk, or multiple floppy disks, you may find
yourself in a default drive and path other than where the external commands are
located.  Then, when you type a command, you will just get an error message:
"Bad command or filename."

Solve this problem by using the ^1PATH^0 command.  This internal command that you
tell DOS where to find commands and executable files that are not in the
current directory.  The syntax is as follows:

     ^1PATH pathname;pathname;...

where each pathname is a drive and/or path specification.  You can list one or
more pathnames; all listed paths will be searched in the order you list them
to find commands.  For instance, if you use this command:

     ^1PATH c:\;c:\big-blue\07\;a:;b:

when you type a name that is not an internal command, DOS will first look for
it in the current directory (which is always searched, even if it is not in the
^1PATH^0 statement), then in the root directory of drive C, then in the
subdirectory C:\BIG-BLUE\07; then on drives A and B.  If the command is not
found on any of these, you get the normal "Bad command or filename" error
message.

You can use this to make all the commands and programs you want at your
fingertips no matter what subdirectory or drive you're currently on.

Some cautions:  The longer the list of paths specified, the longer DOS takes to
find something deep within the list of paths.  The longer each directory that
must be searched is, the slower the search will be.  If you mistype a command,
then it may take a while for your PC to get back to you.

Also, if you include floppy drives in the path, then make sure there is always a
disk inserted in each of them; otherwise, you will get errors, just like with
the ^1PROMPT^0 command described above.

Another thing:  DOS will only use the ^1PATH^0 statement to find executable
programs when you type their names from the command prompt.  All other file
access, such as data files opened by a program, or programs chained to within
another program, is done independently of the ^1PATH^0 statement.  Thus,
programs still expect to find their data in the current subdirectory unless a
different path is explicitly stated in the program or unless the program
searches the path also.  This may keep some programs from being run properly
when you are not in the proper directory.
