home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-08-12 | 102.0 KB | 1,997 lines |
- The |TDOSKEY|T Command
-
- This command is new to DOS version 5.0 and you're going to love it! You
- know the editing keys that DOS has always used before? Well they are
- helpful up to a point, but they're nothing compared to |nDOSKEY|n!
-
- It's a TSR, but it only takes 4.5K of RAM even if you enlarge its inter-
- nal buffer size to 1024 bytes, and it's just about the most useful 4.5K
- you ever spent! Of course you can LOADHIGH it if you have a 386 with
- some extended memory.
-
- What does it do? Well it's very much like 4DOS's command line editing
- and aliasing, and it's very much like the third-party History and Alias
- and CED utilities. There are a lot of little utilities that have been
- written over the years to perform these functions, but now DOS has its
- own, and since it comes with DOS it's guaranteed to work with DOS.
-
- It remembers all the commands you've issued for a while, and you can
- recall them and edit and re-issue them, instead of just retyping some
- <page down> for more
- DOSKEY continued
- fifty-character long command that you just issued five minutes ago. You
- can use the <Home> and <End> keys, <Insert> and <Delete> characters,
- change whatever you want to change in a previous command, or just re-
- enter it the way it was.
-
- Another benefit of |nDOSKEY|n is that you can type more than one command on a
- line, and execute them all at once, instead of typing one, waiting for it
- to complete, typing the next, waiting, etc., whenever you know exactly
- what commands you're going to execute next. For example if you have a
- large file that you want to move from the C: drive to the B: drive, in-
- stead of typing |nCOPY|n C:FILE.EXT B: and then waiting for that to finish,
- then typing DEL C:FILE.EXT, you can instead type |nCOPY|n C:FILE.EXT B:
- <Ctrl-T> |nIF|n |nEXIST|n B:FILE.EXT DEL C:FILE.EXT and hit <Enter>, and it will
- be done automatically. (The reason for the IF EXIST command is in case
- the COPY operation fails, then the source file won't get automatically
- deleted, but if the |nCOPY|n is successful, then it will.) Now whenever you
- type <Ctrl-T> to separate the commands that you are typing all on one
- command line, a symbol will appear on the command line. That's normal;
- <page down> for more
- DOSKEY continued
- that's what it's supposed to do. Of course with DOS we've always been
- able to type the next command while the last command is still executing,
- but only up to fifteen characters. On the sixteenth character the key-
- board buffer is full and the computer just beeps. With |nDOSKEY|n you can
- enter successive commands up to 128 characters instead of only fifteen.
-
- Well as soon as you execute the |nDOSKEY|n command the first time after each
- reboot, that loads it into memory and then it starts remembering every
- command that you enter. When its internal buffer gets full, it forgets
- the oldest command so that there is room for the next command you type.
- It always remembers the most recent commands, however many can fit in the
- size of buffer you have chosen to use.
-
- The <Up arrow> key will show you the previous commands that you have en-
- tered, one at a time, starting with the most recent one. The <Down ar-
- row> key will show you the command that you entered right after you en-
- tered the one you're looking at. Of course if you're looking at the last
- command you entered, the <Down arrow> key will show your |ncurrent|n command
- <page down> for more
- DOSKEY continued
- line, which is blank. Once you find a command that you would like to re-
- issue, just hit the <Enter> key, or edit it first by using the <Home>,
- <End>, <Insert>, <Delete>, and <Arrow> keys and then hit <Enter>.
-
- The <F7> key will show you all the commands that |nDOSKEY|n has stored in its
- buffer, in a numbered list. To choose a command from the list, hit <F9>
- and |nDOSKEY|n will ask you which numbered command you want to execute. Type
- its number and off you go!
-
- My favorite is the <F8> key. If you want to execute the last command
- that started with "DI" but it was quite a while ago so you don't want to
- go looking for it with the <Up arrow> key, just type DI and hit <F8> and
- it will show you the last command you entered that started with "DI" and
- if that's not the right one, hit <F8> again and it will show you the last
- "DI" command before that. When you find the one you want, hit <Enter>.
-
- The <Page Up> key shows you the very oldest command that is still in DOS-
- KEY's buffer, and <Page Down> shows you the most recent command.
- <page down> for more
- DOSKEY continued
- Now here are all the keys that you can use to edit previous commands be-
- fore you re-enter them, or to edit the command you're presently typing.
- First of all, the regular DOS editing keys we've always used still work
- for the |ncurrent|n command. (They work a bit different though, than without
- |nDOSKEY|n installed, especially if you use the /INSERT switch, so be careful
- until you adjust.) But |nDOSKEY|n adds all of the following:
-
- The <Home> key takes the cursor to the leftmost character in the command.
- <End> takes you to the space after the rightmost character. The <Left>
- and <Right> arrows move the cursor one space in the indicated direction.
- <Ctrl-Left> and <Ctrl-Right> move the cursor to the first character past
- the last space past the cursor's |ncurrent|n position. That sentence needs
- an example, huh? Suppose the command line you're working on says this:
- ABC DEF GHI JKL MNO
- Now if your cursor is on the J, <Ctrl-Left> will take you to the G. But
- if the cursor is on the K, L, space, or M, then it will take you to the
- J. If the cursor is on the D, E, F, or space, the <Ctrl-Right> will take
- you to the G.
- <page down> for more
- DOSKEY continued
- The <Backspace> key deletes the character to the left of the cursor. The
- <Delete> key deletes the character that the cursor it on. <Ctrl-End>
- deletes the character that the cursor is on, as well as all the rest of
- the characters to the end of the line. <Ctrl-Home> deletes all the char-
- acters to the left of the cursor, making the character that the cursor is
- on become the first character of the command.
-
- The <Insert> key toggles insert mode on and off. If insert mode is on,
- any character you type will cause the character the cursor is on, and all
- the characters to the right of it, to move to the right to make room for
- the characters that you type. If insert mode is off, then whatever you
- type will replace the character that the cursor is on. If you have DOS-
- KEY set up so that insert mode is the default, then every time you hit
- the <Enter> key to carry out a command, it goes back to insert mode even
- if you were in replace mode when you finished editing that command. The
- same thing goes if your |ndefault|n is replace mode; hitting <Enter> takes
- you back into your |ndefault|n mode even if you had used the <Insert> key to
- temporarily change modes.
- <page down> for more
- DOSKEY continued
- The <Esc> key erases the entire line that you're working on.
-
- You can even use |nDOSKEY|n to create an actual batch file on disk, if you
- want to execute the |nbatch file|n as you write it. Just type the <Alt-F7>
- keystroke combination, which erases the |nDOSKEY|n buffer, then execute the
- commands that you want the |nbatch file|n to contain, then type this:
- |nDOSKEY|n /HISTORY > NAME.BAT
- where NAME.BAT is the |nbatch file|n that you want to create. The |nDOSKEY|n
- /HISTORY switch displays a list of all the commands that are currently in
- the buffer, and since you cleared the buffer before you started, "all the
- commands" means just those commands you wanted in the |nbatch file|n. Then
- the > means that DOS should use redirection to send that list to a file
- named NAME.BAT instead of sending it to the screen as it normally would.
- The /HISTORY switch can also be abbreviated as /H.
-
- Not only that, but you can also create what DOS calls "|smacros|s" with DOS-
- KEY. They're not really |nmacros|n though. That term generally means using
- one keystroke in the place of a whole bunch of keystrokes. But |nmacros|n is
- <page down> for more
- DOSKEY continued
- what DOS called these |nDOSKEY|n things, so we'll have to live with it. DOS-
- KEY's |nmacros|n are really more like |sbatch file|ss than anything else. Just
- really fast batch files though, since |nmacros|n are stored as part of DOS-
- KEY's internal buffer so they're always in memory and never need to be
- read off the disk except the first time you create the |nmacros|n during each
- session. Don't worry about the fact that the <Alt-F7> combination clears
- |nDOSKEY|n's buffer. It doesn't wipe out the |nmacros|n, just the |nmemory|n of the
- most recent commands you've entered.
-
- Another way in which |nDOSKEY|n |nmacros|n are better than batch files is that
- the files in which they are stored on disk don't take up any disk space.
- I mean if you put the |nDOSKEY|n macro-creating commands in your AUTOEXEC.BAT
- file, that won't take up any more disk space than the |nAUTOEXEC.BAT|n file
- without macro commands did, unless you put in so many macro commands that
- the |nAUTOEXEC.BAT|n file gets larger than 2048 bytes, because of the way DOS
- deals with disks. Any file, no matter how small, takes up a whole clus-
- ter of disk space, so an |nAUTOEXEC.BAT|n with a bunch of |nDOSKEY|n |nmacros|n that
- is 1987 |nbytes|n long, doesn't take any more disk space than an |nAUTOEXEC.BAT|n
- <page down> for more
- DOSKEY continued
- file with no |nDOSKEY|n |nmacros|n that is 38 bytes long. For example, you could
- put fifteen |nDOSKEY|n |nmacros|n in your AUTOEXEC.BAT file and delete fifteen of
- the batch files you used to use, and that would free up fifteen clusters
- which is 30K of disk space.
-
- There are a few other ways in which a |nDOSKEY|n macro is different from a
- batch file. Since the |nmacros|n are stored in memory instead of on disk,
- you don't have to have access to a disk-based .BAT file in order to exec-
- ute a macro. It's just like the macro were an internal DOS command.
-
- A macro can only have a total length of 127 characters because the whole
- macro goes on one line and DOS commands can only have 128 characters in-
- cluding the carriage return (the <Enter> key), whereas there is no limit
- to the length of a |nbatch file|n.
-
- You can terminate a |nbatch file|n by pressing <Ctrl-C> or <Ctrl-Break>, but
- pressing one of those combinations while a macro is executing will only
- terminate the command that's running right now. The next command in the
- <page down> for more
- DOSKEY continued
- macro, and all the ones following it, will still get executed, just as if
- you had used <Ctrl-Break> in a batch file and answered "N" when it asked
- "Terminate batch job?"
-
- In |nDOSKEY|n |nmacros|n you use $1 through $9 instead of the usual %1 through %9
- for replaceable parameters. You can also use the |nreplaceable|n parameter
- $* in |nmacros|n, and what it means is "all parts of the command tail togeth-
- er", even if it's more than nine |nparameters|n, instead of just one "word"
- at a time as $1 through $9 mean. For example, if you had a macro named
- HELLO and you entered the command HELLO ABC DEF GHI at the prompt, $1 is
- ABC, $2 would be DEF, and $3 gets GHI. But $* would be ABC DEF GHI.
-
- The redirection characters that can be used in |nDOSKEY|n |nmacros|n are quite
- different from the normal ones. $L is used in place of <, $G for >,
- $G$G for >>, and $B for ||.
-
- You cannot use the GOTO or SHIFT commands or turn ECHO off in a |nDOSKEY|n
- macro, or even use the @ symbol to suppress the display of a command.
- <page down> for more
- DOSKEY continued
- You cannot in any way execute a second macro from within one macro, as
- you can do using the CALL command for batch files. You can't run a macro
- from within a batch file either, but that's not a big problem since the
- purpose of a macro is to save keystrokes. You don't need to save key-
- strokes inside a |nbatch file|n, since you only need to create it once.
-
- You can't access an environment variable from within a macro as you can
- from within a |nbatch file|n, with a construction such as %PATH%.
-
- To create one of these |nDOSKEY|n |nmacros|n, for example if you wanted to create
- a macro that would clear the screen and give you a directory listing of
- the current |ndirectory|n with the /W and /P switches, you'd just enter this
- command: |nDOSKEY|n MYDIR=CLS $T |nDIR|n /W /P and from that point on, until you
- reboot the computer, every time you enter the command MYDIR, the commands
- CLS and |nDIR|n /W /P will be executed for you. Any |nmacros|n that you want to
- have active every time you start your computer should have their macro-
- creating commands in your AUTOEXEC.BAT file.
-
- <page down> for more
- DOSKEY continued
- To create a |nDOSKEY|n macro that uses replaceable parameters, it's done just
- the same way as it's done in a batch file, but $1 through $9 are used in-
- stead of %1 through %9, and if your macro contains more than one command,
- they are all placed on the same line with the $T symbol separating com-
- mands. For example,
- |nDOSKEY|n DIRTYPE=DIR $1 $T |nPAUSE|n $T |nTYPE|n $1 $B |nMORE|n
- Now every time you execute the command DIRTYPE FILENAME, the following
- commands will be executed:
- |nDIR|n FILENAME
- |nPAUSE|n
- |nTYPE|n FILENAME || |nMORE|n
- Because $1 means the first "word" that's typed on the command line after
- the name of the macro, and $B in |nmacros|n is the || symbol.
-
- You can also make a macro that has the same name as a regular DOS com-
- mand. For example if you had a macro that cleared the screen and then
- did a DIR command, you could name it |nDIR|n if you wanted to. DOS would
- execute the macro instead of the internal DOS |nDIR|n command whenever you
- <page down> for more
- DOSKEY continued
- enter DIR as a command. But if you need to execute the regular |nDIR|n com-
- mand instead of your macro, you can just type a <Space> between the DOS
- prompt and the |nDIR|n command, and that way DOS would not recognize it as a
- macro, but would recognize it as an internal command or executable file.
- Isn't that strange?
-
- After you create some |nDOSKEY|n |nmacros|n and decide you want to use them
- permanently, you can just type |nDOSKEY|n /|nMACROS|n > NAME.BAT to create a
- batch file called NAME.BAT which will contain all the |nmacros|n that you
- currently have stored in memory. Now if you edit that file and put the
- |nDOSKEY|n command and a <Space> in front of each line, you will have creat-
- ed a |nbatch file|n that you can run each time you boot your computer, which
- will load all of those |nmacros|n into |nmemory|n. This is similar to the way
- you use |nDOSKEY|n /HISTORY > NAME.BAT to create a |nbatch file|n as described
- above, but that makes a file out of all the commands you have typed at
- the DOS |nprompt|n. The /|nMACROS|n switch calls up a list of all the |nmacros|n
- you have created since you last rebooted your computer. It can also be
- abbreviated as /M.
- <page down> for more
- DOSKEY continued
- If your |nDOSKEY|n internal buffer gets too full to store any more |nmacros|n,
- you can delete one by setting it equal to nothing, as in |nDOSKEY|n DIRTYPE=
- but that won't give the buffer space back to the part of the buffer that
- stores every command you type. It will only free it up for more |nmacros|n.
- You can delete all the |nmacros|n from the |ncurrent|n |nDOSKEY|n buffer by typing
- the <Alt-F10> keystroke combination.
-
- Since the dollar sign ($) is used in |nDOSKEY|n |nmacros|n to represent a lot of
- different things, if you want to use a dollar sign that does not have a
- special meaning to |nDOSKEY|n, you use a double dollar sign. For example, if
- you have a file named FILE$ and you want to have a macro that backs up
- that file to a different disk, then when you enter the command which cre-
- ates that macro, the filename will have to be entered as FILE$$, like
- this: |nDOSKEY|n BAK=COPY FILE$$ B:. |nDOSKEY|n will see the double dollar sign
- in that macro definition and know that it's not supposed to do anything
- special with that particular dollar sign, even though most dollar signs
- are supposed to be interpreted in some way by the |nDOSKEY|n command.
-
- <page down> for more
- DOSKEY continued
- When you first load |nDOSKEY|n into memory, usually in your AUTOEXEC.BAT
- file, if you want its internal buffer to be anything other than 512 bytes
- then you have to tell it so, since 512 is the default. You can set the
- size anywhere from 256 |nbytes|n on up. |nDOSKEY|n /BUFSIZE=#### will do it.
-
- You can also tell |nDOSKEY|n whether you want it to |ndefault|n to insert mode
- or replace (overstrike) mode. |nDOSKEY|n /INSERT or |nDOSKEY|n /OVERSTRIKE will
- do that. The |ndefault|n is overstrike so you only need to use that if you
- (or your |nAUTOEXEC.BAT|n file) had previously used the command |nDOSKEY|n /IN-
- SERT since the last time you |sreboot|sed.
-
- The |nDOSKEY|n command also has a switch called /REINSTALL but I can't imag-
- ine why anyone would want to use it. It loads another copy of |nDOSKEY|n
- into |nmemory|n, taking up extra |nmemory|n. It also clears the buffer, but you
- can do that with the <Alt-F7> and <Alt-F10> combinations, so why would
- you want to load a new copy of |nDOSKEY|n into |nmemory|n? I don't know. But
- if you want to, you can, by entering |nDOSKEY|n /REINSTALL.
-
- <page down> for more
- DOSKEY continued
- Well there was a lot of information in that section, huh? How about a
- review?
-
- Entering more than one command at a time:
-
- <Ctrl-T> separates commands on the command line
-
- Finding a command to edit:
-
- <Up arrow> displays previous command
- <Down arrow> displays next command
- <Enter> executes command
- <F7> numbered list of all commands in buffer
- <F8> type TEXT, then it finds last command that began with TEXT
- <F9> executes a command from the numbered list displayed by <F7>
- <Page Up> earliest command in buffer
- <Page Down> most recent command
-
- <page down> for more
- DOSKEY continued
- Editing commands:
-
- <Home> moves cursor to first character of command
- <End> moves cursor to end of command
- <Left arrow> moves cursor to left
- <Right arrow> moves cursor to right
- <Ctrl-Left> moves cursor to beginning of last word
- <Ctrl-Right> moves cursor to beginning of next word
- <Backspace> deletes character left of cursor
- <Delete> deletes character under cursor
- <Ctrl-Home> deletes all characters left of cursor
- <Ctrl-End> deletes all characters right of cursor
- <Insert> toggles between insert and replace (overstrike) modes
- <Escape> erases the |ncurrent|n command line
-
- Naming macro with same name as a DOS command:
-
- <Space>NAME allows execution of command with same NAME as a macro
- <page down> for more
- DOSKEY continued
- Erasing the |nDOSKEY|n buffer:
-
- <Alt-F7> erases the command buffer
- <Alt-F10> erases the macro buffer
-
- Writing macro definitions:
-
- $1 -- $9 |nreplaceable|n |nparameters|n; same as %1 -- %9 in batch files
- $* a |nreplaceable|n parameter that means the entire command tail
- $L for |nredirection|n; the < symbol
- $G for |nredirection|n; the > symbol
- $G$G for |nredirection|n; the >> symbol
- $B for |nredirection|n; the || symbol
- $T to separate commands
- $$ to represent a dollar sign inside a macro
-
-
-
- <page down> for more
- DOSKEY continued
- Switches for the |nDOSKEY|n command:
-
- /BUFSIZE=#### size of |nDOSKEY|n buffer for commands and |nmacros|n; |ndefault|n 512
- /HISTORY (/H) display of all commands in buffer
- /INSERT makes insert mode the |ndefault|n
- /|nMACROS|n (/M) display of all |nmacros|n in buffer
- /OVERSTRIKE makes replace mode the |ndefault|n again if /INSERT was used
- /REINSTALL loads a new copy of |nDOSKEY|n into |nmemory|n, clears buffer
-
- Here is an excerpt from my AUTOEXEC.BAT file which shows all the |nDOSKEY|n
- parts. Notice that you must load the |nDOSKEY|n TSR into memory before you
- begin issuing any macro-making commands:
- C:\DOS\DOSKEY /BUFSIZE=1024 /INSERT
- C:\DOS\DOSKEY C=COMSAVER $*
- C:\DOS\DOSKEY PCS=C:\PCT\PCSHELL
- C:\DOS\DOSKEY THES=CD C:\AW\THES $t THESAUR $t CD\
- C:\DOS\DOSKEY CB=COMSAVER BROWSE $1
- C:\DOS\DOSKEY 4=CD C:\UTIL $t 4DOS $t CD\
- C:\DOS\DOSKEY HLP=C:\SIMPLY\HLPURSLF C:\SIMPLY\SIMPLY1
- The |TECHO|T Command
-
- This is a batch file command, but it does have some uses on the command
- line. It's used to display text on the screen, or to tell DOS not to
- display text on the screen.
-
- Whenever DOS loads a copy of the COMMAND.COM file into memory, whether it
- be the first copy or another copy, the state of echo is on. Whenever DOS
- finishes executing a |nbatch file|n, and returns to the prompt, it turns echo
- on. What echo on means is that whatever commands are executed from with-
- in a |nbatch file|n, will show on the screen as they are read from the batch
- file. If you don't want the commands to show on the screen as they are
- executed, then you want to turn echo off. Then later in the same batch
- file if you want the commands to display again, you turn echo back on.
- You can also use the |nECHO|n command to display your own text on the screen.
- And the |nECHO|n command all by itself with no parameters, will make DOS tell
- you whether the |ncurrent|n state of echo is off or on.
-
- Suppose you have a |nbatch file|n named TEST.BAT which contains these lines:
- <page down> for more
- ECHO continued
- DATE
- TIME
- VER
- |nDIR|n
- Now, you execute that batch file by typing TEST <Enter>. Here's what
- will happen to your screen (minus the blank lines):
- C:\>TEST
- C:\>DATE
- |nCurrent|n date is Mon 06-24-1991
- Enter new date (mm-dd-yy): _
- C:\>TIME
- |nCurrent|n time is 05:30:53.72p
- Enter new time: _
- C:\>VER
- MS-DOS Version 5.00
- C:\>DIR
- Volume in drive C is drive C
- Volume Serial Number is 16CB-74E4
- <page down> for more
- ECHO continued
- |nDirectory|n of C:\
- COMMAND COM 47855 05-09-91 5:00a
- AUTOEXEC BAT 861 06-18-91 4:58p
- CONFIG SYS 287 06-17-91 6:58p
- 3 file(s) 49003 |nbytes|n
- 69025792 |nbytes|n free
- C:\>
- C:\>
- Now if you were to add |nECHO|n OFF as the first line of that batch file, and
- leave the rest the same, here's what your screen would do instead:
- C:\>TEST
- C:\>ECHO OFF
- |nCurrent|n date is Mon 06-24-1991
- Enter new date (mm-dd-yy): _
- |nCurrent|n time is 05:30:53.72p
- Enter new time: _
- MS-DOS Version 5.00
- Volume in drive C is drive C
- <page down> for more
- ECHO continued
- Volume Serial Number is 16CB-74E4
- |nDirectory|n of C:\
- COMMAND COM 47855 05-09-91 5:00a
- AUTOEXEC BAT 861 06-18-91 4:58p
- CONFIG SYS 287 06-17-91 6:58p
- 3 file(s) 49003 |nbytes|n
- 69025792 |nbytes|n free
- C:\>
- A lot less clutter on the screen this time, huh? First of all, until af-
- ter the first command has executed, echo is still on, so you see the |nECHO|n
- OFF command. (In DOS version 3.3 or later, you can use the @ symbol to
- supress the display of any command even when echo is on so if you changed
- that line to @ECHO OFF, then it wouldn't show on the screen either.) But
- after that, no more prompts get sent to the screen, and only the output
- of each command shows, not the commands that cause the output.
-
- Then at the end, notice that there is only one prompt this time. You
- see, when echo is on, DOS is displaying the |nprompt|n for each line, then
- <page down> for more
- ECHO continued
- looking to see if there is another command in the batch file to be exec-
- uted or not. Well after the DIR command, DOS finds that there aren't any
- commands left, so it closes up the |nbatch file|n interpreter and turns echo
- on (which doesn't matter this time because echo was on the whole time)
- and displays another prompt. But when echo is off, DOS is not displaying
- a |nprompt|n in between each command of the |nbatch file|n, so that last |nprompt|n
- that would be showing while DOS looks to see if there are any commands
- left in the |nbatch file|n, doesn't show on the screen. No prompts show on
- the screen until the batch interpreter is closed down and echo is turned
- back on.
-
- How about an example of using the |nECHO|n command to display text onscreen?
- |nECHO|n HELLO.
- |nECHO|n HOW ARE YOU?
- Now if that |nbatch file|n were executed, the screen would be like this:
- C:\>ECHO HELLO.
- HELLO.
- C:\>ECHO HOW ARE YOU?
- <page down> for more
- ECHO continued
- HOW ARE YOU?
- C:\>
- C:\>
- Not exactly what you had intended, right? Well make the first line of
- that batch file @ECHO OFF, leave the rest the same, and execute it:
- HELLO.
- HOW ARE YOU?
- C:\>
-
- Well you can also use the |nECHO|n command at the DOS prompt instead of in a
- |nbatch file|n, but that's only appropriate if you're using redirection to
- send the output of the |nECHO|n command to some other device instead of to
- the screen. For example, |nECHO|n HELLO > PRN would make your printer type
- the word HELLO. (See the section on Device|1s.)
-
- Another sort of a device that you can redirect output to, is a filename.
- You could actually write a |nbatch file|n to disk by using the |nECHO|n command
- with |nredirection|n. Note that the > symbol creates a brand new file by the
- <page down> for more
- ECHO continued
- name you specify, and if that file already existed at the time, it gets
- erased. A double >> sign means for DOS to add the text to the already
- existing file, without deleting the file first. So to create the above
- TEST.BAT file, you could use these commands from the DOS prompt:
- |nECHO|n DATE > TEST.BAT
- |nECHO|n TIME >> TEST.BAT
- |nECHO|n VER >> TEST.BAT
- |nECHO|n |nDIR|n >> TEST.BAT
-
- The |nECHO|n command always sends along a carriage return (the <Enter> key)
- at the end of each thing that it sends, so that batch file you just cre-
- ated does not say DATE TIME VER |nDIR|n. It's got each command on a separate
- line just like it's supposed to.
-
- If you try to display instructions containing one of the redirection
- characters using the |nECHO|n command, |nredirection|n will take place and the
- results will not be what you expected. For example, a command like:
-
- <page down> for more
- ECHO continued
- |nECHO|n Type |nTYPE|n FILENAME.EXT > PRN
- |nECHO|n to print out this file.
- will send the words "Type |nTYPE|n FILENAME.EXT" to the printer. In later
- versions of DOS, though, you can get the results you wanted by using
- |nECHO|n Type "|nTYPE|n FILENAME.EXT > PRN"
- The quotation marks keep DOS from performing the redirection.
-
- If you execute the command |nECHO|n all by itself with no parameters, it will
- say either "|nECHO|n is on" or "|nECHO|n is off". So how do you get it to send a
- blank line to the screen from within a |sbatch file|s? Well in recent DOS
- versions, it will work if you give |nECHO|n. as a command. That's right,
- |nECHO|n-period with no <Space> between. If that doesn't work for your ver-
- sion, you can try |nECHO|n<Space><F7> which will look like |nECHO|n ^@. The ^@
- is the ASCII 0 character which represents the null character, looks like
- a <Space>, but isn't a <Space> and in most DOS versions will make |nECHO|n
- display a blank line. If you have DOS version 5 though, and you're run-
- ning the DOSKEY program, or if you're running any other version and have
- your <F7> key programmed via ANSI.SYS to stand for something else, then
- <page down> for more
- ECHO continued
- <F7> won't give you ^@. In that case, find out how your text editor goes
- about accepting control characters in the text, and use |nECHO|n <Ctrl-H>
- which is a <Backspace> character. But if you're using a version of DOS
- that's so old that |nECHO|n. doesn't work, especially now that Microsoft is
- selling DOS 5.0 to the public instead of only to computer dealers, you
- should go get version 5.0 and find out just what you've been missing!
-
-
-
-
-
-
-
-
-
-
-
-
-
- The |TDRIVPARM|T Command
-
- This command is used in the CONFIG.SYS file, but it's pretty rare that
- it's needed. It's only necessary if you replace an old floppy drive or
- add a new one, that is not supported by the BIOS in your machine or by
- your DOS version. It sets the drive characteristics for existing physic-
- al drives. If you can read and write disks in your |nfloppy|n drive but you
- can't properly FORMAT brand new |ndisks|n, then this is probably the command
- that will help you.
-
- If you think you need to try this command, check your DOS manual because
- the syntax and |sdefault|ss are different for different DOS versions. Also
- some brands of DOS don't even support this command. If you can't make
- this work, then try DRIVER.SYS which is a device driver that sets up
- logical drives inside of physical drives.
-
- But if you do use the |nDRIVPARM|n command, for heaven's sake don't give it
- any incorrect information. Tell it the truth, the whole truth, and noth-
- ing but the truth.
-
- The |TEDIT|T Command
-
- This command is new with DOS 5.0, and if you hate EDLIN then you're going
- to love this one! It's a full screen ASCII text editor, with pull-down
- menus, mouse support, configurable colors, and on-line help.
-
- You can't use this command if the |nQBASIC|n.EXE file is not in the same dir-
- ectory with the |nEDIT|n.COM file, or else in a directory listed on your PATH
- variable in the environment, or else in the current |ndirectory|n.
-
- You can start the EDITor from within DOSSHELL, or at the command line.
- From the shell, it's in the Main Group. From the prompt, just type |nEDIT|n
- and the name of the file you want to edit. For example, |nEDIT|n |nCONFIG.SYS|n
- or |nEDIT|n C:\WORD\LETTER.DOC or if you want to create a new file, just |nEDIT|n
- will do.
-
- To pull down a menu from within the EDITor, all you have to do is hit one
- of the <Alt> keys, and the menu bar will light up. Choose the letter of
- the menu you want to see, and there it is. Use the <Left> and <Right>
- <page down> for more
- EDIT continued
- arrow keys to move to a different menu, or use <Up> and <Down> to move
- to a different selection. Hit <Enter> to make a selection. To go back
- to editing without selecting a menu option, use <Esc>.
-
- The |nEDIT|n command depends on the code in the |nQBASIC|n.EXE file for its op-
- eration, and since the PC-DOS QBASIC command depends on some code in the
- ROM of a true IBM brand computer, this means that PC-DOS's |nEDIT|n command
- won't work on anything but a true IBM computer. So if you have a clone,
- you'll have to have MS-DOS in order to use this command.
-
- To get help, just put your cursor on the menu item for which you want
- more information and press <F1>. If you need help in general about how
- the EDITor works, when you first start it up, don't give a filename, and
- you will see a screen that offers you a Survival Guide. Choose that.
-
- Well, the chapter about the EDITor in the manual is so well done that be-
- tween it and the online help, you won't need anything else from me about
- it. Have fun!
-
- The |TEXE2BIN|T Command
-
- This is a command you're not going to need for quite some time. If you
- don't already know what it is, then you may as well erase it from your
- hard drive to save space. It converts .EXE files to .BIN files, and that
- is not anything you're ever going to want to do unless you're a software
- developer.
-
-
-
-
-
-
-
-
-
-
-
-
-
- The |TEXPAND|T Command
-
- This command is new with DOS version 5.0, and if you install DOS properly
- using its own SETUP program, you'll probably never need to use this com-
- mand. You may have noticed that most of the filenames on the disks in
- the upgrade package are missing the last character of their extensions.
- For example, all the .COM files have an extension of .CO_. Well the
- files are also compressed, so that they take up less disk space. They
- are not usable at all in this format. The |nEXPAND|n command can put them
- back to their normal usable form.
-
- Here's an example of the syntax you use:
- |nEXPAND|n A:\HIMEM.SY_ C:\DOS\HIMEM.SYS
- That will take the compressed HIMEM.SYS file from the disk in drive A:,
- expand it to its usable form, and give it its proper name, and put it in
- the \DOS directory on drive C:. So if you accidentally deleted the HIMEM
- .SYS file from your \DOS |ndirectory|n and you couldn't get it back with the
- UNDELETE command, or if you had QEMM installed when you installed DOS 5.0
- and the SETUP procedure didn't install the |nHIMEM.SYS|n file to begin with,
- <page down> for more
- EXPAND continued
- that's how you can get it back.
-
- If you need to expand more than one file from the original DOS disks,
- you can do something like this:
- |nEXPAND|n A:\HIMEM.SY_ A:\EMM386.EX_ A:\ATTRIB.EX_ C:\DOS
- That command will expand all three of those files from the original DOS
- |ndisks|n, but it will put them into the C:\DOS directory with the same sil-
- ly names they have now. You'll have to use the RENAME command to make
- them usable. You can't specify the full filenames for the |nexpanded|n files
- if you expand more than one file at at time.
-
- You can't use wildcards with this command. That's pretty rare, huh?
-
-
-
-
-
-
-
- The |TFASTOPEN|T Command
-
- I would not recommend this command to my worst enemy. It's just like a
- tiny disk cache, only not nearly as well-behaved. Get yourself a disk
- |ncache|n and get rid of this command.
-
- Well, what it does is, it stores parts of the directory entries and FAT
- that you have already accessed, in RAM which is fast, so that the next
- time you need to access those same parts, you can get them from memory
- instead of from the slow hard disk. Yes, that's exactly what a |ncache|n
- does, only the |ncache|n does |nFAT|n and |ndirectory|n entries, and all other types
- of disk information as well. And the |ncache|n does it less dangerously.
-
- Well I guess it would be pretty silly of me to tell you the syntax for
- this command after I just got done telling you not to use it, huh? So I
- guess I won't.
-
-
-
-
- The |TFCBS|T Command
-
- This command is used in the CONFIG.SYS file. It tells DOS how many File
- Control Blocks to keep available. Only old applications are still using
- FCBs. Nowadays File Handles are used instead. That's what the FILES
- command in |nCONFIG.SYS|n is for. These are the two methods that DOS has
- used to keep track of open files, files that are in use at the moment by
- some application. |nFCBS|n is the old way, |nFILES|n is the new way. DOS's
- default setting for |nFCBS|n is 4, and valid values are 1 through 255. You
- really won't need to use this command unless you use some application
- that tells you in its manual to use this command. The syntax is FCBS=#
- where # is the number you want to use, from 1 to 255.
-
-
-
-
-
-
-
-
- The |TFC|T Command
-
- This command is a lot like COMP, only better. It compares one file to
- another. It's a good idea to use one of these commands after using the
- COPY command, if you copy a file that's really important, and you want to
- make absolutely sure that the |nCOPY|n command worked perfectly. There's no
- need to do this on a regular basis though, because DOS just doesn't make
- mistakes all that often. But any time you are tempted to use the /V
- switch with the |nCOPY|n command, you're better off leaving out the /V and
- using |nCOMP|n or |nFC|n after the copy is made, instead.
-
- If your version of DOS has the |nFC|n command, use it. Otherwise, use |nCOMP|n.
- (However, if you're using a disk cache, none of these methods will do you
- any good, since what will actually get compared is the destination copy
- and the copy in the |ncache|n, rather than the source copy on the disk.) Af-
- ter the |nCOPY|n command is done type |nCOMP|n and press <F3> and <Enter>. Since
- |nCOMP|n has the same number of letters as |nCOPY|n, that will compare the source
- file and the destination file. (See editing keys.) If you want to use
- |nFC|n instead, then after the copy type |nFC|n and hit <Del> <Del> <F3> <Enter>.
- <page down> for more
- FC continued
- That will delete the P and the Y from the template (DOS's |nmemory|n of the
- last command you entered) and then copy the rest of it, the source and
- destination filenames, to the |ncurrent|n command line. This way, you make
- sure you end up comparing the right files with each other, without making
- any typos, and without even having to type the filenames over.
-
- The output of this command is the last line that matches in both files
- right before some lines that are different, followed by the lines that
- don't match, and finally the first line that matches again. If there is
- another mismatch between the files, then you'll see the corresponding
- sequence of lines for that difference, and then the next difference if
- there is another one, etc. If there aren't any differences, |nFC|n will tell
- you that instead.
-
- The syntax for the |nFC|n command is really easy:
- |nFC|n D:\DIR\FILE1.EXT D:\DIR\FILE2.EXT
- where D: is the drive letter for each file, \DIR\ is the directory name
- for each file, and FILE#.EXT are the names of the files you want to com-
- <page down> for more
- FC continued
- pare. Of course as usual, whatever parts of the file specifications are
- the defaults, can be left out. If one of the files is in the current
- directory, you can leave out the D:\DIR\ part for that file and just say
- |nFC|n FILE1.EXT D:\DIR\FILE2.EXT and of course if the second file has the
- same name as the first, then you can use *.* for its filename, as in:
- |nFC|n FILE1.EXT D:\DIR\*.*
-
- There are lots of switches with this command, that can make it do slight-
- ly different things. /A /B /C /L /LB# /N /T /W and /# are the possible
- switches. The /B switch causes a binary comparison rather than an ASCII
- comparison, and if you use the /B switch then you don't want to use any
- of the other switches with it. If you are comparing files that have the
- extension .BIN, .COM, .EXE, .LIB, .OBJ, or .SYS, then this is the default
- so you don't need to specify the switch. A |nbinary|n comparison means that
- the output will be displayed like 00000015: B8 0F. That's the offset ad-
- dress of the mismatch (that means how many bytes past the first byte in
- the file) and the hexadecimal codes for the byte in the first file, and
- the hex code for the byte in the second file that didn't match it. The
- <page down> for more
- FC continued
- rest of the switches are for ASCII comparisons, which means the lines
- that don't match are displayed in normal text form.
-
- The /A switch gives an abbreviated output. That means that if there is
- more than one line in a row that don't match between the two files, all
- the mismatched lines won't be displayed. Just the last matching line
- before the mismatch, then a ... symbol to show that other lines exist,
- then the first matching line after the mismatch. Of course if there's
- only one line that doesn't match, that line will be displayed, since it
- takes up as much room on your screen to show the line as it takes to show
- the ... line that just stands for other lines.
-
- The /C switch tells |nFC|n to ignore the case of the letters, so that HELLO
- will not be regarded as a mismatch with hello.
-
- /L is the default for |nASCII|n files, so it's only used when you want to
- make an |nASCII|n comparison on a file that has the extension of .BIN, .COM,
- .EXE, .LIB, .OBJ, or .SYS.
- <page down> for more
- FC continued
- The /LB# switch tells DOS how many lines in a row are allowed to be dif-
- ferent, without causing the |nFC|n command to abort. The default is 100.
- The /N switch makes |nFC|n display the line number along with each line. The
- /T switch causes |nFC|n to not expand tabs to spaces. The /W switch causes
- |nFC|n to treat a bunch of consecutive spaces like just one space. The /#
- switch tells |nFC|n how many lines after a mismatch have to match before |nFC|n
- should consider that the files are matching again. The |ndefault|n is 2. I
- can't think of any reason why a body would really want to worry about
- that switch. In fact most of the time you'll want to use no switches, or
- maybe the /C or /N switch. You can pretty much ignore the rest.
-
- With one exception. If all you're interested in is making sure that two
- files are identical, and you're not expecting there to be any differences
- so you don't care whether the display of the differences is friendly or
- not, then either use the /B switch with this command, or use the COMP
- command. Either way is much much faster than doing an ASCII comparison
- with the |nFC|n command.
-
-
- The |TEMM386|T Command
-
- Well previous to DOS version 5.0, |nEMM386|n.SYS was just a device driver
- that could simulate LIM 4.0 expanded memory in the extended |nmemory|n on a
- 386 or higher computer. But in DOS 5.0, we have |nEMM386|n.EXE instead of
- the .SYS version. It's both a |ndevice driver|n and a command. Now isn't
- that strange?
-
- If you have a |n386|n or higher computer with |nextended|n RAM, and if you have
- the command DOS=HIGH,UMB in your CONFIG.SYS file, and you have a DEVIC|1E
- command for the HIMEM.SYS |nextended|n |nmemory|n manager, then you can use this
- command in your |nCONFIG.SYS|n file:
- DEVICE=C:\DOS\EMM386.EXE NOEMS
- and you will be able to use the DEVICEHIGH and LOADHIGH commands to put
- your device drivers and |sTSR|ss into Upper |nMemory|n.
-
- If you have enough |nextended|n |nmemory|n and you make that line like this:
- DEVICE=C:\DOS\EMM386.EXE |nRAM|n
- then you can do the same thing, only you'll also get |nexpanded|n |nmemory|n.
- <page down> for more
- EMM386 continued
- This will eat up some of your upper memory, for the expanded |nmemory|n page
- frame, so don't use |nRAM|n in place of NOEMS unless you have an application
- that uses |nexpanded|n |nmemory|n.
-
- This line has to be placed into the CONFIG.SYS file after the HIMEM.SYS
- line but before the lines for any DEVIC|1E commands that load a device that
- uses |nexpanded|n |nmemory|n, and before any DEVICEHIGH commands.
-
- There are a whole bunch of additional switches and parameters that can be
- used with the |nEMM386|n device driver, but you probably won't need any of
- them. They're listed in the manual if you do.
-
- The |nEMM386|n |ndevice driver|n without the NOEMS or |nRAM|n |nparameters|n only enables
- |nexpanded|n |nmemory|n emulation (that means that the XMS |nmemory|n pretends to be
- |nexpanded|n |nmemory|n), but in order to get |nUpper|n |nMemory|n support, you need one
- of those |nparameters|n.
-
- Now |nEMM386|n can also be used as a command from the DOS prompt if you need
- to enable or disable the EMS after it has been created via |nCONFIG.SYS|n.
- The |TFDISK|T Command
-
- This command is used to create, delete, or change hard drive partitions
- and to create, delete, or change logical drives within a partition. Par-
- titions and |nlogical drives|n on a hard drive just make it so that you can
- have a C: drive and a D: drive and an E: drive, or whatever you want, in-
- stead of having a great big C: drive by itself. |nFDISK|n just divides the
- hard drive into different sections, and DOS references each section with
- a different drive letter, even though it's really still part of the same
- physical hard drive.
-
- If you have an MS-DOS or PC-DOS version earlier than 4.0, then you can't
- have any hard drive partition larger than 32 mega|sbytes|s. If you have ver-
- sion 4 you can have a larger partition but you have to install the SHARE
- TSR every time you boot your computer. If you have version 5, you can
- have whatever size partitions you want without using |nSHARE|n.
-
- A partition that's smaller than 16 megs will have a 4K cluster size, and
- that's not good. Because every file on the disk, even a tiny batch file
- <page down> for more
- FDISK continued
- that's only 27 bytes long, will use up a whole cluster of disk space. A
- partition larger than 16 meg will have only 2K in each cluster, so that
- way you only waste half as much disk space with a tiny file. Unless the
- partition is too large, that is, like over 128 megs, because those par-
- titions also have the 4K cluster size, or even larger!
-
- Don't ever forget that if you change anything about a logical drive or
- a partition, with the |nFDISK|n command, every single speck of data on that
- logical drive or partition will be lost. Make sure you have a perfectly
- good backup before you do anything with |nFDISK|n other than just switching
- the active partition or displaying partition information. Anything under
- the Create Partition or Delete Partition menu entries will remove all the
- data from the partition involved and from the ones with higher letters.
-
- Another thing that happens when you create or delete logical drives or
- partitions, is that drive letters change. For example, if you have a C:
- drive and a D: drive, and you use a RAMdisk whose letter is E:, and then
- you use |nFDISK|n to remove your D: partition and put the entire drive space
- <page down> for more
- FDISK continued
- into C:, then the next time you boot up your RAMdisk will have the letter
- D: instead of E:, because a |nRAMdisk|n just gets the next letter in order
- after whatever real drives you have. So you'll need to change all your
- |sbatch file|ss that reference the |nRAMdisk|n to make them say D: instead of E:.
-
- If your hard drive came with its own partitioning software, then use it
- instead of the |nFDISK|n command.
-
- After you've changed any partition on your hard drive, you must FORMAT it
- before it can be used. And if you're going to Low-Level Format your hard
- drive, then that must be done before the |nFDISK|n procedure.
-
- To enlarge a partition, you must delete it and then recreate it.
-
- The |nFDISK|n command won't let you delete a partition without your entering
- the correct volume label, so if there's something funky about your label
- and |nFDISK|n won't accept the label as you type it, exit back to DOS and use
- the LABEL command to change the label to something else that |nFDISK|n will
- accept.
- The |TFILES|T Command
-
- This command is used in the CONFIG.SYS file, and it tells DOS how many
- files can be open or in use at one time. File handles is the new way
- that DOS goes about keeping track of open files, whereas FCBS is the old
- way. If you have an application that tells you to have FILES=15 in your
- |nCONFIG.SYS|n file, and another application that tells you to have FILES=30,
- then use FILES=30. Just use the highest number that any of your applica-
- tions tells you to use.
-
- The higher the number you give in your |nFILES|n command, the more memory
- will be used by the table that DOS sets up to keep track of the file han-
- dles, so don't use more than you need. Then again, DOS only uses 39
- bytes for each file handle above the default, so having 50 file handles
- is only going to use up 1638 |nbytes|n and that's not very much, so if you
- have an application that requires FILES=50, don't let it depress you.
- You can have anywhere from 8 up to 255, and the |ndefault|n value that DOS
- will use if you don't have a |nFILES|n command in your |nCONFIG.SYS|n file is 8.
-
-
- The |TFIND|T Command
-
- This is a highly useful command. It will search any file for any string
- of text. Of course it's only likely to work on pure ASCII files, because
- a file created by a word processor has control codes embedded in it, to
- tell it where the margins go and where the words should be in italics,
- and things like that. So the word "little" with control codes embedded
- in it might look like "littlΣ" so if you use the |nFIND|n command to look for
- "little", it won't be found. But for |nASCII|n files, the |nFIND|n command works
- wonderfully.
-
- Well here's how you use it. Suppose you want to search for the word
- "little" in the files named FILE1, FILE2, and FILE3:
- |nFIND|n "little" FILE1 FILE2 FILE3
- will do it. But it won't find the word "little" if it's capitalized at
- the beginning of a sentence. For that you need this command:
- |nFIND|n "Little" FILE1 FILE2 FILE3
- But in DOS version 5.0, there's a new switch to the |nFIND|n command. The /I
- switch tells DOS to ignore the case of the letters so that |nFIND|n "little"
- <page down> for more
- FIND continued
- will find "little" and "Little" and "LITTLE" and "liTtlE".
- |nFIND|n /I "little" FILE1 FILE2 FILE3
- would do that if you have DOS version 5.0 or later.
-
- If you're using the |nFIND|n command as a filter (explained later in this
- section) to find a filename in your directory listings, be sure to type
- the filename in capital letters (or else use the /I switch if you have
- DOS version 5.0) because filenames are always stored in the |ndirectory|n
- listings in all-caps, so |nFIND|n won't find the file HITHERE if you tell
- it to search for "ither", but |nFIND|n "ITHER" would work.
-
- The output of the find command would be like this:
- ---------- FILE1
- Mary had a little lamb,
- ---------- FILE2
- ---------- FILE3
- Little Red Riding Hood took a basket of fruit to her sick .....
- When Little Red Riding Hood got to her grandmother's house,....
- <page down> for more
- FIND continued
- It shows the name of each file as it begins searching it, then it shows
- each line that contains the word being searched for. If the word is not
- found in a particular file, it doesn't say anything, it just goes on to
- search the next file.
-
- If you're searching more than one file at a time, you have to type out
- each filename separately. Wildcards can't be used with the |nFIND|n command.
- Of course you could get around that by using the FOR command, as in:
- |nFOR|n %a IN (FILE*) DO |nFIND|n /I "little" %a
-
- Remember that the |nFIND|n command will search for exactly what you tell it
- to search for, no more, and no less. If you tell it to search for "and"
- it will find "and" "hand" "land" and "grandmother". If you tell it to
- search for " and " that would make it leave out "hand" and "land" and all
- that, but it will also leave out "and," because there is a comma after
- "and" instead of a <Space>. If you're searching for the word "renamed"
- and the word does exist in the file but it's hyphenated at the end of a
- line, so that it exists in the file in the form "re-" on one line and
- <page down> for more
- FIND continued
- "named" on the next line, then |nFIND|n won't find it at all. The same thing
- if you're searching for a string that is more than one word long, such as
- "my birthday". If "my" is at the end of one line and "birthday" is at
- the beginning of the next line, then |nFIND|n won't find "my birthday" be-
- cause there's a carriage return instead of a <Space> between those words.
-
- If the string you want to search for contains any quotation marks, you
- have to type two quotation marks for each one in the string. For exam-
- ple, to find the string <He said, "Why don't we go to the mall?"> you
- have to use this command:
- |nFIND|n "He said, ""Why don't we go to the mall?"""
- Each quotation mark in the string you're looking for is replaced by two
- quotation marks, and then the entire string is also enclosed in one more
- set of quotation marks as usual.
-
- If the file you're searching has a <Ctrl-Z> (End-of-File marker) in it,
- the |nFIND|n command won't search any of the text past that point.
-
- <page down> for more
- FIND continued
- The |nFIND|n command has other switches that change its output a little bit,
- and these switches are for all DOS versions, not just 5.0.
-
- The /V switch tells DOS to find all the lines in the file that do not
- contain the string you're searching for. Just the opposite of normal.
- Suppose you want to use |nFIND|n as a filter (described below) to find all
- the files in the current directory that were not updated today.
- |nDIR|n || |nFIND|n /V "6-27-91"
- would do it.
-
- The /C switch tells DOS to just count the number of lines that contain
- the search string. It won't display the lines, it will only count them.
- For example, if you want to know how many lines are in the entire file,
- |nFIND|n /C /V "%$#@!" FILENAME.EXT
- would do it, because the /V tells |nFIND|n to look for lines that do not con-
- tain the string %$#@! and that's going to be all of them, right? Then
- the /C switch will count how many lines matched the search, and that's
- the total number of lines in the file.
- <page down> for more
- FIND continued
- The /N switch tells |nFIND|n to display line numbers with each line. So the
- output in this case will be the line that contains the search string, and
- the line number for that line, for each line that contains the string.
- It might look like this:
- [2]Little Red Riding Hood took a basket of fruit to her .......
- [16]When Little Red Riding Hood got to her grandmother's ......
-
- Well that's all there is to the |nFIND|n command in its normal command form,
- but that's definitely not the only way to use it. It can also be used as
- a filter. (Go read the section on redirection and then come back here.)
-
- A filter is a little command that takes STanDard INput from the keyboard,
- performs some function on that input, and then sends STanDard OUTput to
- the monitor. The three filters that come with DOS are |nFIND|n, MORE, and
- SORT.
-
- When you don't supply a filename on the |nFIND|n command line, then you're
- using it as a filter. Well it doesn't do much good to take input from
- <page down> for more
- FIND continued
- the keyboard and send output to the screen. That's why I told you to go
- read about redirection first. If you redirect the input from somewhere
- else, and/or redirect output to somewhere else, then a filter is very
- useful.
-
- |nFIND|n "string" < FILE1 > FILE2
- will create a file named FILE2 that contains only those lines from FILE1
- that contain "string".
-
- |nTYPE|n FILE1 || |nFIND|n "string" || |nFIND|n /V "smaller string" > PRN
- will print a list of all the lines in FILE1 that contain "string" but
- do not contain "smaller string".
-
- |nDIR|n || |nFIND|n "AB"
- will show you all the lines in your directory that contain the string AB
- in either the filename or the extension.
-
- |nDIR|n || |nFIND|n /V "<DIR>"
- <page down> for more
- FIND continued
- will show you all the lines in your directory that are not subdirectory
- listings.
-
- |nDIR|n || |nFIND|n /V "e"
- will show you a |ndirectory|n listing without the lines that say "Volume in
- drive C is..." and "... |nbytes|n free".
-
- (Of course if you have DOS version 5.0, you can get those last two dis-
- plays by using the new switches to the DIR command instead of using
- |nFIND|n.)
-
- Well you see that the |nFIND|n command has about a million uses. Play around
- with it and see what you can do.
-
-
-
-
-
-
- The |TGRAPHICS|T Command
-
- This command loads a TSR into memory, that will allow you to use the
- <PrtScrn> or <Shift-PrtScrn> key to print your screen even when you're
- not looking at a plain old text screen. You'll probably want to use the
- /R switch which tells DOS to print black characters on white paper,
- otherwise DOS will tell the printer to print the background in black and
- leave white spaces in the shape of the letters. Isn't that silly? That
- will take about a year to print, and about a ribbon and a half!
-
- If you have DOS version 4 or later, you'll find a file named |nGRAPHICS|n.PRO
- in your DOS directory. That's the instruction profile that |nGRAPHICS|n will
- use to talk to the printer. If your printer is not closely enough com-
- patible with an IBM printer, then hopefully your printer dealer supplied
- you with your own .PRO file to use. Just rename it to |nGRAPHICS|n.PRO and
- the |nGRAPHICS|n command will use it automatically. It must be in the same
- |ndirectory|n with the |nGRAPHICS|n.COM file though.
-
-
-
- The |THELP|T Command
-
- This command is new to DOS version 5. If you type just |nHELP|n, you'll get
- a list of all the DOS commands and a very short description of what each
- is for. If you type this command followed by the name of another com-
- mand, such as |nHELP|n |nATTRIB|n, then the |nHELP|n command will load a copy of the
- ATTRIB command and feed it the /? switch. So you'll get the exact same
- result as if you'd typed |nATTRIB|n /?. Because all the commands in DOS 5.0
- have a little screen of syntax information inside them.
-
- For an example, here's what you'll see if you type |nMD|n /? or |nHELP|n |nMD|n:
- Creates a |ndirectory|n.
-
- |nMKDIR|n [drive:]path
- |nMD|n [drive:]path
-
- Not all that helpful, huh? Only if you've temporarily forgotten how to
- use the command, not if you didn't already know how to use it.
-
-
- The |TINSTALL|T Command
-
- This command is used in the CONFIG.SYS file, to load a TSR into memory.
- It can only be used with TSRs that you don't hotkey into, and that don't
- require any help from the command interpreter, because at the time CON-
- FIG.SYS is read, COMMAND.COM (the command interpreter) hasn't been load-
- ed into |nmemory|n yet.
-
- You can use this command for FASTOPEN, GRAPHICS, KEYB, NLSFUNC, SHARE,
- and many others, but not all TSRs.
-
- The advantage of using the |nINSTALL|n command in |nCONFIG.SYS|n to load TSRs,
- rather than loading them the normal way from the AUTOEXEC.BAT file, is
- that all TSRs loaded after |nCOMMAND.COM|n has been loaded, receive a copy of
- the environment. This wastes |nmemory|n. If you load a |nTSR|n from |nCONFIG.SYS|n,
- |nCOMMAND.COM|n is not in |nmemory|n yet so there is no |nenvironment|n, so obviously
- the |nTSR|n can't get a copy of it to waste |nmemory|n like that.
-
- The only disadvantages of the |nINSTALL|n command that I can think of, are
- <page down> for more
- INSTALL continued
- that it doesn't work for all TSRs, and that if you're using DOS version
- 5, there is no INSTALLHIGH command, so you can't LOADHIGH any TSRs that
- you load from CONFIG.SYS in this manner. And the |nINSTALL|n command didn't
- even exist until DOS version 4.
-
- The syntax is quite simple. Just |nINSTALL|n followed by an equals (=) sign
- and then the full |spath|sname for the TSR you want to install:
- INSTALL=C:\DOS\SHARE.EXE /F:1024 /L:20
- (The /F and /L switches are parameters for the SHARE command, not for the
- |nINSTALL|n command.) You do have to include the full pathname for the com-
- mand file, unless it is in the root directory of the boo|1t disk, because
- at the time the |nCONFIG.SYS|n file is read, AUTOEXEC.BAT hasn't been run yet
- so the |nPATH|n variable in the environment does not exist, so DOS can't find
- the file unless it's in the |nroot|n |ndirectory|n of the |nboot|n disk, or unless
- you specify the full |npath|n on the |nINSTALL|n command line. And you don't
- want to leave the command file in the |nroot|n |ndirectory|n, because that clut-
- ters it up. So go ahead and keep the file in a subdirectory and use the
- full pathname as in that example above.
-
- The |TLABEL|T Command
-
- This command is used to put an internal label onto a disk. You know,
- when you do a DIR command and it comes up and says, "Volume in drive C
- is Whatever"? "Whatever" is the volume label.
-
- You can use the /V switch with the FORMAT command to put the label on,
- or you can use the |nLABEL|n command. The syntax is incredibly simple:
- |nLABEL|n C:
- |nLABEL|n A:
- Whatever drive's disk you want to label, you just put that letter and
- a colon after the |nLABEL|n command.
-
- Now DOS will come back and say what the |ncurrent|n volume label of the disk
- is, and ask you what you want to change it to. You type what you want,
- anything up to eleven characters and it can include spaces, and hit the
- <Enter> key. If you want to leave the same label, or if you want to de-
- lete the label, then you just hit <Enter> without typing anything. It
- will ask you if you want to delete the label, so just answer the question
- <page down> for more
- LABEL continued
- with Y or N depending on what you want to do.
-
- In recent DOS versions, you can also include the new label on the command
- line, like this:
- |nLABEL|n C:NEW NAME
- and then it won't ask you anything. If that won't work for your version
- of DOS, and you need to be able to do this without the command asking you
- for further input, for example for use in a batch file, you can probably
- use |nECHO|n NEW NAME || |nLABEL|n C: instead. (See redirection.)
-
- Volume labels are stored as directory entries, and they show up in your
- CHKDSK readouts as Hidden files as well, even though they don't take up
- any disk space like files do.
-
-
-
-
-
-
- The |TLASTDRIVE|T Command
-
- This command is used in the CONFIG.SYS file to tell DOS how many drives
- you are going to need to be able to access. The default is E so if you
- have five or fewer drives, then you have no need for this command. But
- if you already have five drives and you add a RAMdisk or you use the
- DRIVER.SYS device driver to create more logical drives, then you need to
- use this command to tell DOS you need more drive letters.
- LASTDRIVE=F
- is all there is to the syntax of this command.
-
- It does take memory for DOS to keep track of all your drives (about 100
- bytes each), so don't use the command LASTDRIVE=Z (the highest allowed)
- unless you really do use 26 drives!
-
- In DOS version 5, the |ndefault|n is not necessarily E. It's one letter
- higher than the actual number of physical drives you have. For example,
- if you only have two floppy drives and a drive C:, then the |ndefault|n will
- be D:. If you have four |nfloppy|n drives and two hard drive partitions,
- then the |ndefault|n will be G.
- The |TLOADFIX|T Command
-
- This command is new to DOS version 5. It is necessary for some programs
- because since DOS can load its kernel into high memory, that means that
- programs and applications that are used to loading in a certain general
- area of |nmemory|n, end up loading a lot lower in |nmemory|n than they are used
- to because DOS isn't sitting there in the way. Well some programs just
- don't deal with it very well, and give an error message such as "Packed
- file corrupt". If this happens to you, for example with a program named
- HELLO.EXE that's in your C:\UTIL directory, then just issue this command
- instead of HELLO: |nLOADFIX|n C:\UTIL\HELLO.EXE
-
- That will load the HELLO.EXE program above the first 64K of conventional
- |nmemory|n, so that the program won't flip out over where it got loaded at.
-
-
-
-
-
-
- The |TLOADHIGH|T Command
-
- This command is new to version 5.0 of DOS. If you have a 386 or higher
- computer, with extended memory, and if you have the proper HIMEM, EMM386,
- and DO|1S commands in your CONFIG.SYS file, then you can use this command
- to load TSRs into the Upper |nMemory|n Blocks.
-
- If you have a line in your AUTOEXEC.BAT file that loads a screen-saver
- TSR that looks like this:
- C:\UTIL\EXPLOSIV M2
- then you would change that line to look like this:
- |nLOADHIGH|n C:\UTIL\EXPLOSIV M2
- and the next time you reboot the computer, the screen saver will be in
- |nupper|n |nmemory|n instead of taking up space in your conventional RAM.
-
- If you load too many TSRs with this command so that you run out of up-
- per |nmemory|n space, nothing bad will happen. The excess TSRs will just
- get loaded into |nconventional|n |nmemory|n.
-
- This command can be abbreviated as LH. (See also |sDEVICEHIGH|s!)
- The |TMKDIR|T Command
-
- This command is used to MaKe a new DIRectory. It can also be abbrevi-
- ated as MD. The syntax is just |nMKDIR|n D:\DIR\NAME where D: is the drive
- you want to put the new |ndirectory|n on, and |nDIR|n is the |ndirectory|n you want
- to put the new |ndirectory|n under. Of course whatever parts of that command
- are the |sdefault|ss, you can leave out. Some examples:
- |nMKDIR|n C:\WORD\DOCS
- would make a |ndirectory|n named DOCS underneath the WORD |ndirectory|n on the
- C: drive.
- |nMKDIR|n \WORD\DOCS
- would make a |ndirectory|n named DOCS under the WORD |ndirectory|n on whatever
- drive is current at the time.
- |nMKDIR|n DOCS
- would make a |ndirectory|n named DOCS under the |ncurrent|n |ndirectory|n of the cur-
- rent drive. If the |ncurrent|n |ndirectory|n of the |ncurrent|n drive were C:\WORD,
- then the above three commands would all do the exact same thing.
- |nMKDIR|n \DOCS
- makes a |ndirectory|n named DOCS in the root |ndirectory|n of the |ncurrent|n drive.
- <page down> for more
- MKDIR continued
- The longest |spath|sname you're allowed to have is 63 characters, so keep the
- names short. For example, instead of a name like WORDPROC for your word
- processor, use WP or WORD. That way, if your subdirectories end up very
- deeply nested, you won't exceed the 63-character limit. Then again, you
- probably won't want to make any subdirectories more than three or four
- directories deep anyway.
-
-
-
-
-
-
-
-
-
-
-
-
-
- The |TMORE|T Command
-
- This command takes its input from the keyboard and sends its output to
- the monitor, one screenful (23 lines) at a time. What good does that do?
- Not a whole lot. But wait, this is a very useful command after all. Be-
- cause you can use it with input redirection, to make it take its input
- from a file instead. Have you ever used the TYPE command on a large file
- and watched it scroll by on your screen about ten thousand times faster
- than you could read it? |nTYPE|n FILENAME || |nMORE|n or |nMORE|n < FILENAME would
- make the file go to your screen just one screenful at a time, and at the
- end of each page it would say "-- More --" and that tells you to hit any
- key to make it continue. When you hit a key, it will show you one more
- screenful, etc.
-
- Be very careful to make sure you understand the concept of |nredirection|n
- before you go using the second method above, with the < symbol. Because
- if you accidentally use the > symbol instead, every byte of data in that
- FILENAME file will be erased. Permanently. It won't be recoverable with
- the UNDELETE command or anything else. The first method above, with the
- <page down> for more
- MORE continued
- || symbol, is much safer although it does have its drawbacks.
-
- The drawbacks of the || method are that it takes more keystrokes, because
- you have to use the TYPE command, and that any time you use the || symbol
- you create two temporary files on the current disk. If the |ncurrent|n drive
- is a floppy, that temp file is going to slow you down. If the disk in
- the |ncurrent|n drive is |swrite-protect|sed, you won't be able to use the || sym-
- bol at all. And if you use <Ctrl-C> to break out of the operation after
- you hit the <Enter> key, the temp files will be left laying around on the
- disk. (Of course if you have version 5.0 or later, then the temp files
- used by the operation of the || symbol will be created in whatever drive
- and directory is pointed to by the TEMP environment variable, and it ap-
- pears that breaking out with <Ctrl-C> no longer leaves the files sitting
- there, so none of this is a problem.) But despite these drawbacks of the
- || method, it's still worth it to use until you're absolutely sure you un-
- derstand the difference between > and <, for the safety of the file you
- want to display.
-
- <page down> for more
- MORE continued
- You can also use this command to send the output of some other command
- through it. For example, |nCHKDSK|n |n*.*|n /V || |nMORE|n, so that you can see the
- CHKDSK report before it all scrolls off the screen. Just about any time
- your screen tries to show you something faster that you can read it, the
- |nMORE|n command will let you slow it down. (Except for while your AUTOEXEC
- .BAT and CONFIG.SYS files are executing. For that, all you can do is use
- your <Pause> key, which isn't all that good of an idea during bootup, or
- put PAUSE as the first command in AUTOEXEC.BAT and put another |nPAUSE|n com-
- mand every two or three lines, save this edited |nAUTOEXEC.BAT|n file, reboot
- and you'll be able to see all those messages that normally fly by. Now
- edit the file again to remove those |nPAUSE|n commands, and you're back to
- normal.)
-
- If any of this is confusing you, check out the section on redirection to
- learn about the <, ||, and > symbols and what they do.
-
-
-
-
- How Do You |tWrite-protect|t a |sFloppy|s?
-
- That's easy! On a 5.25-inch disk, there is a little notch near the |nupper|n
- right corner, and if you cover that notch up with something that infrared
- light can't pass through, the disk is write-protected.
-
- On a 3.5-inch disk, there is a little hole in the |nupper|n right corner that
- has a little slidey-gadget in it. If the hole is closed by the slidey-
- gadget, the disk is not write-protected. If you slide the slidey-gadget
- up so that light can go through the hole, then it is write-protected.
-
- Notice that the situation is reversed between 5.25-inch and 3.5-inch
- disks. On the 5.25, if light can go through, it's not write-protected,
- but on the 3.5, if light can go through, it is write-protected. Goofy.
-
- On a 3.5-inch |nHigh|n Density disk, you'll see that there is also another
- hole, in the |nupper|n left corner, that doesn't have a slidey-gadget. That
- one has nothing to do with write-protection. It is only there to tell
- the drive that it's a HD disk instead of a Double Density disk.
- <page down> for more
- Write-protect continued
- Now what does write-protecting a disk do? Well it protects the disk from
- having DOS write any information to it. DOS can't delete or change any
- file on a disk while it is write-protected, because the disk drive has
- some sensor in it, that detects whether light will go through that spot
- on the disk's cover or not, and if the disk is write-protected, the drive
- won't let any write-|ncurrent|n through the read/write heads.
-
- However, if there is a power surge that causes some |nhigh|n voltage to "ac-
- cidentally" travel through the drive's heads, I don't think that write-
- protection will protect the spot on the disk that the heads happen to be
- sitting above. But anything that deliberately tries to write to a disk
- will be stopped by the write-protection.
-
- Some disk drives have a little mechanical "pin" that checks for the hole,
- rather than a beam of infrared light. And maybe some drives have regular
- light instead of infrared. But as long as the notch on a 5.25" disk is
- covered with some material that neither pin nor light can get through,
- then the disk is write-protected. And remember that 3.5" disks are back-
- wards from 5.25" ones--if light goes through then it is write-protected.
- The |TGOTO|T Command
-
- This is a batch file command, which has no purpose at the DOS prompt.
- But in a |nbatch file|n, it's a great command. It sends the execution to
- some other part of the |nbatch file|n, instead of continuing on with the
- commands as they are listed in order.
-
- Suppose that you want to perform a certain set of commands based on the
- results of an IF test. Like this, perhaps:
- @ECHO OFF
- |nIF|n |nEXIST|n |nAUTOEXEC.BAT|n |nGOTO|n YES
- (here go the commands that you want performed if the file AUTO-
- EXEC.BAT does not exist in the current |sdirectory|s)
- |nGOTO|n END
- :YES
- (here go the commands that you want performed if AUTOEXEC.BAT
- does exist in the |ncurrent|n |ndirectory|n)
- :END
-
- <page down> for more
- GOTO continued
- The word that comes after the |nGOTO|n command is called a label, and when
- the label is later repeated in the batch file, at the point where you
- want the |nGOTO|n to jump to, the label must be preceded by a colon (:) as
- shown in that example. Also, don't forget the |nGOTO|n END statement after
- the "no" commands, or else the "yes" commands will be executed after the
- "no" commands are finished. And if you have a |nGOTO|n END statement, then
- you sure do have to remember to put the :END label in the |nbatch file|n
- somewhere, or you'll get a nasty "Label not found" error message, and
- the |nbatch file|n will just quit and leave you with a DOS prompt.
-
- Another good use for the |nGOTO|n command is in conjunction with replaceable
- parameters. You can use |nGOTO|n %1 at the beginning of your |nbatch file|n, and
- that way you could combine all of your little batch files into one great
- big |nbatch file|n, to save disk space (since every file takes a whole clus-
- ter of disk space even if the file is only 17 bytes long). Let's say you
- have batch files named 1.BAT, 2.BAT, and 3.BAT and you want to combine
- them into one |nbatch file|n called GO.BAT. Here's how:
-
- <page down> for more
- GOTO continued
- @ECHO OFF
- |nIF|n NOT '%1==' |nGOTO|n %1
- |nECHO|n The syntax of this command is %0 followed
- |nECHO|n by a label, where the available labels are
- |nECHO|n 1, 2, and 3. For example, to perform the
- |nECHO|n tasks that used to be in 1.BAT, you enter
- |nECHO|n %0 1
- |nGOTO|n END
- :1
- (here go the commands that used to be in 1.BAT)
- |nGOTO|n END
- :2
- (here go the commands that used to be in 2.BAT)
- |nGOTO|n END
- :3
- (here go the commands that used to be in 3.BAT)
- |nGOTO|n END
- :END
- <page down> for more
- GOTO continued
- (See the sections on ECHO, IF, and Replaceable Parameters for more infor-
- mation.)
-
- So now you can delete your 1.BAT, 2.BAT, and 3.BAT files (after you've
- tested to make sure that your new GO.BAT file works right) and free up
- two clusters of disk space. Because GO.BAT is still small enough to fit
- all in one cluster, so it's only taking up as much space as 1.BAT used to
- take up by itself.
-
- Notice that in a batch file, %0 always refers to the name of the batch
- file that the %0 is inside of. So in that example above, every place
- that says "%0" in the |nbatch file|n will be replaced with "GO" when you
- actually run the |nbatch file|n. But if you change the name of the batch
- file to MENU.BAT, then you won't have to change the inside of the batch
- file, because now every place that says "%0" will say "MENU" instead.
-
- Remember that only the first 8 characters of a label are noticed by DOS,
- so |nGOTO|n REMEMBER1 is the same as |nGOTO|n REMEMBER2, as far as DOS is concer-
- <page down> for more
- GOTO continued
- ned. Having two different labels that are only different in their ninth
- character does no good. Also, every time DOS goes looking for a label
- that a |nGOTO|n command pointed to, it starts at the very beginning of the
- file, and glances at each line, so if you have a :HERE label near the
- beginning of the file and a :HERE label near the end, the one at the be-
- ginning is the only one DOS will ever |nGOTO|n.
-
- You can also use labels as comments, just like the REM command, because
- if there is no |nGOTO|n command that points to a particular label, DOS won't
- mind, or even notice it. DOS completely ignores any line that starts
- with a colon (:), unless it's looking for a specific label because a |nGOTO|n
- command told it to. You can write anything you want in a batch file af-
- ter a colon, as long as you have the correct label for every |nGOTO|n command
- in the file, it doesn't matter if you also have seventy more labels if
- you want to. You can also add comments on the same line with a real la-
- bel, because DOS is only going to pay attention to the first word follow-
- ing the colon. As long as there is a <Space> between the real label and
- the comments, DOS won't care.
-
- What Is the |tBIOS|t?
-
- |nBIOS|n stands for Basic Input/Output System. This is the instructions in
- the ROM of the computer that tell it how to communicate with the peri-
- pherals such as the drives, the keyboard, the comm ports, etc. DOS talks
- to the |nBIOS|n real often, because each computer is a little different from
- every other computer, so DOS couldn't possibly know how to communicate
- with every type of hardware. So the |nBIOS|n is like the translator between
- DOS and the hardware. AMI and Phoenix are both very popular brands of
- |nBIOS|n, and every make and model of computer has its very own version.
-
-
-
-
-
-
-
-
-
-
- Why Do I Need to |tPark|t My Hard Drive?
-
- A hard drive is sort of like a record player, in that it has some disks
- that hold information, and heads that move on an arm to read that infor-
- mation. Only the read/write heads on the hard drive float a hair's
- breadth above the surface of the |ndisks|n.
-
- Now when someone bumps into the computer, the heads might get jarred and
- crash into the surface of the disk, which would most likely destroy the
- data in that spot of the disk, and even damage the disk itself.
-
- If there's a power surge in the electric lines, a shock might go through
- the computer, including the heads on the disk, and that would also damage
- the data in whatever spot the heads happened to be above at that moment.
-
- And every time you turn on the |npower|n to your computer, there is a sudden
- shock of voltage moving through all parts of the computer's circuitry.
- Again, whatever part of the disk the heads happen to be sitting above,
- could very well lose its data.
- <page down> for more
- Park continued
- Parking a hard drive means that the read/write heads are moved over to an
- area of the disk called the landing zone, so that any of these events can
- happen and no data will be damaged. Only an unused portion of the disk
- might be damaged. No problem.
-
- Most recent models of hard drives use voice coil rather than stepper mo-
- tor actuators, and these are self-parking. That means that whenever pow-
- er is removed, the heads automatically retract to the parked position.
-
- That means that turning on the power again is not a threat to your data,
- but what about the whole time it's running? Obviously you can't have the
- heads parked the whole time, or you couldn't get any work done. But if
- you get up for a cup of coffee, or to answer the doorbell, what if the
- dog rushes past and bumps into the computer? What if there's a |npower|n
- surge?
-
- If you can call the manufacturer of your hard drive, and ask them if it's
- ok for your particular brand and model, you should |npark|n your hard drive
- <page down> for more
- Park continued
- every time you leave your desk for a second!
-
- But be aware that I meant it when I said to ask the manufacturer of your
- specific disk, because using a parking program that was made for one type
- of disk, on another type of disk, can ruin the drive!
-
- If you have an older hard drive which uses a stepper motor instead of
- a voice coil actuator, you really need to use a parking program! It's
- likely that one came with your disk. If so, use it every time you leave
- your desk, and especially make it the last thing you do before each time
- you turn off the |spower|s!
-
- Some older parking programs can be really dangerous, as they were intend-
- ed for only one particular type of hard drive, and as I said, using the
- wrong parking program for the drive can ruin it! But parking programs
- written recently generally check the BIOS to see where is the safe area
- to |npark|n on your particular drive, before doing anything else. These pro-
- grams are safe to use on any drive, if your |nBIOS|n is correct.
- <page down> for more
- Park continued
- If you have a 286 or newer machine, do you know who entered your CMOS
- setup? Was it someone reliable, or was it the computer salesman? (Those
- are mutually exclusive categories.) You might want to call the manufac-
- turer of the drive and make sure you have the right numbers in |nCMOS|n for
- the write precomp and landing zone especially, along with all the other
- hard drive settings.
-
- Many commercial disk utility packages such as PC Tools and SpinRite in-
- clude a |nPARK|n.COM file. There is even a public domain parking program
- called TIMEPARK that is a TSR, that parks your hard drive every time it
- hasn't been accessed for X minutes (you choose what the X number is). If
- your hard drive manufacturer says it's ok, then using a parker like that
- is the ultimate in safety!
-
- Now, how do you unpark your drive when you need to access it again? Well
- if you have a PC or XT, I think all of those had parking programs that
- couldn't be unparked without a cold boot. If that's the case with your
- parking program, you will get a message on your screen every time you
- <page down> for more
- Park continued
- |npark|n, that says something like "Turn |npower|n off now". See if you can call
- the manufacturer of your hard drive and ask them if there is a newer
- parking program that's safe to use on your disk.
-
- Otherwise, all parking programs allow the heads to unpark the second any
- software requests a disk access, whether you've |sreboot|sed since you parked
- or not. For that reason you have to make sure that |nPARK|n is the last com-
- mand you give before shutting off the computer. If any other external
- command is entered, the heads will unpark in order to read the command
- file.
-
-
-
-
-
-
-
-
-
- The |TCOMMAN|1D|T Command
-
- COMMAND is the command that activates a secondary shell of COMMAND.COM.
- Secondary shell, you ask? Well yes, because if there were not already a
- primary |nCOMMAND.COM|n shell, then your computer would just be sitting there
- giving you a cold stare, not even a prompt. A |nCOMMAND.COM|n shell is what
- gives you a |nprompt|n and then interprets the commands that you enter at the
- |nprompt|n. That's why it's also called the Command Interpreter. It might
- be called a shell because it protects you from having to deal with the
- actual binary language that the computer can understand.
-
- Well if you do a lot of shelling out to DOS from inside some application,
- what that application is doing is using the COMSPEC variable to find out
- where your |nCOMMAND.COM|n file is, and loading another copy of that file in-
- to memory right over top of the application you're working on. When you
- are done with what you wanted to do in DOS, you type EXIT and hit <Enter>
- and the secondary |nCOMMAND.COM|n shell drops back out of |nmemory|n and leaves
- you right where you were before, in that application.
-
- <page down> for more
- COMMAN|1D continued
- Well you can also shell out to a secondary command interpreter right from
- the primary command interpreter, without using some application that has
- a shelling out option, as a middle man. You probably won't need to do it
- very often, but when you do, COMMAND is the command you use.
-
- About the most common reason for a beginner to need to shell out to a
- secondary COMMAND.COM is in order to call a second batch file from inside
- another |nbatch file|n. Of course if you have DOS version 3.3 or later, you
- would want to use the CALL command. But since that command didn't exist
- until DOS version 3.3, some people still need to use the COMMAND command
- to accomplish this.
-
- You see, if you just enter the name of a second |nbatch file|n, as a command
- in the first |nbatch file|n, then control will be passed permanently to that
- second |nbatch file|n. When the second |nbatch file|n is done, you'll just get a
- DOS prompt, and whatever commands were still remaining to be executed in
- the first |nbatch file|n, will never be seen by DOS. So if you want DOS to
- come back to the first |nbatch file|n after the second |nbatch file|n is done,
- <page down> for more
- COMMAN|1D continued
- you need the CALL command if you have DOS 3.3 or later, or else you need
- the COMMAND command with the /C switch. Here is FIRST.BAT:
- |nECHO|n This is the first |nbatch file|n
- COMMAND /C SECOND
- |nECHO|n Back in the first |nbatch file|n again
- And here is SECOND.BAT:
- |nECHO|n This is the second |nbatch file|n
- Now when you run FIRST.BAT, the first ECHO command will be executed, then
- a secondary command shell will be loaded and the /C switch tells that
- secondary shell to execute the command following the /C. So SECOND.BAT
- will be called, and then as soon as it's done, since the /C switch was
- used with the COMMAND command, the secondary shell will drop right out
- of memory just as if you had issued the EXIT command, and then FIRST.BAT
- will continue on with the next |nECHO|n command.
-
- If you don't use the /C switch with the COMMAND command, then you can run
- whatever commands or programs you want, and the secondary processor won't
- drop out of |nmemory|n until you give the |nEXIT|n command.
- <page down> for more
- COMMAN|1D continued
- Whenever you load a secondary command processor, it gets a copy of your
- |ncurrent|n environment. So it has the same PATH, PROMPT, and COMSPEC varia-
- bles that you already had, plus whatever else you might have had in your
- |nenvironment|n. Then you can do whatever you want to do with the environ-
- ment while you're in the secondary shell, and it will not affect the or-
- iginal |nenvironment|n. When you EXIT back to the primary shell, you will
- still have the exact same |nenvironment|n you had before you loaded the sec-
- ondary shell.
-
- Also whenever you load a secondary command shell, it starts out with the
- default |nECHO|n ON. So if you use COMMAND /C to call a second batch file
- from within another |nbatch file|n, it does not inherit the same ECHO state
- that existed in the first |nbatch file|n, as happens with the CALL command.
- Even if |nECHO|n was off in the first |nbatch file|n, you'll have to have the
- command |nECHO|n OFF at the beginning of the second |nbatch file|n too if you
- want it to have its |nECHO|n off as well.
-
- If you ever run some other shell besides COMMAND.COM, such as the wonder-
- <page down> for more
- COMMAN|1D continued
- ful shareware program from J. P. Software called 4DOS, that's another oc-
- casion you might be interested in using the COMMAND command. Suppose you
- are running 4DOS as your primary command interpreter, and you're having
- trouble getting some particular command to work. You decide that you
- would like to try the same command in regular DOS, to see if it's just a
- quirk in 4DOS that's giving you trouble, or what. Well you don't have to
- edit your CONFIG.SYS file and reboot in order to load a copy of the regu-
- lar COMMAND.COM to test your theory. You just use the COMMAND command to
- load a secondary shell, try out that command that's giving you trouble in
- 4DOS, and then use the EXIT command to remove the secondary shell. (This
- was not to imply that I think you will find any quirks in 4DOS. It's a
- fantastic program! It does just about everything that you ever wished
- DOS would do but didn't. 4DOS is about 99.99999% compatible with all the
- applications you use under regular DOS, but it's so much better than reg-
- ular DOS! It's even better than DOS version 5!)
-
- Here's another use for the COMMAND command. Have you ever wanted to use
- a nested FOR command, that is, a |nFOR|n command inside another |nFOR|n command?
- <page down> for more
- COMMAN|1D continued
- Kinda the same as using COMMAND or CALL to run another batch file from
- within a first |nbatch file|n. Well in general it's not possible to nest FOR
- commands. But it can be done using the COMMAND /C command. Want to copy
- all the .BAT files from the BELFRY directory, and all the .BAT files from
- the UTIL |ndirectory|n, to the disk in drive B:, all in one command? |nFOR|n %%A
- IN (\BELFRY \UTIL) DO COMMAND /C |nFOR|n %%B IN (%%A\*.BAT) DO |nCOPY|n %%B B:
- would do it. Not that you'll probably ever want to, but isn't it nice to
- know that it can be done if you ever do?
-
- The COMMAND command also has a /P switch, which you might recognize from
- the SHELL command in your CONFIG.SYS file. The switch doesn't belong to
- the |nSHELL|n command, but to the COMMAND command. It causes the command
- processor being invoked, to become the primary command processor, even if
- there already is a primary one loaded. This means that it will run the
- AUTOEXEC.BAT file, and that it cannot be exited with the EXIT command.
- The only way to get rid of a command shell that was invoked with the /P
- switch, is to reboot. So you probably won't ever want to use the /P
- switch except for with the |nSHELL|n command in |nCONFIG.SYS|n.
- <page down> for more
- COMMAN|1D continued
- If you use the COMMAND command from within a batch file, it's a good idea
- to use %COMSPEC% to reference it. COMSPEC is an environment variable
- that points to where your copy of COMMAND.COM is located. And the per-
- cent signs are a way that is used in batch files to reference |nenvironment|n
- variables. Whenever DOS's |nbatch file|n interpreter sees a word surrounded
- by percent signs, it looks into the |nenvironment|n to see if there is a var-
- iable by the name of the word that's inside the percent signs. If there
- is, then DOS temporarily replaces the word (for example %COMSPEC%) with
- whatever the word is SET equal to in the |nenvironment|n (for example C:\DOS\
- |nCOMMAND.COM|n). So if you put %COMSPEC% into your |nbatch file|n in place of
- the word COMMAND, then DOS will replace that with C:\DOS\COMMAND.COM (if
- that's where your |nCOMMAND.COM|n file is) and the correct copy of COMMAND
- .COM will be loaded as the secondary shell. This is good for in case you
- ever end up with some other copy of |nCOMMAND.COM|n on your disk in a direc-
- tory that's closer to the beginning of your PATH variable than the copy
- of |nCOMMAND.COM|n that is the one you really want to run. Because DOS will
- execute the first |nCOMMAND.COM|n it finds on the |npath|n if you just say COM-
- MAND in the |nbatch file|n. If you say %COMSPEC% instead, in the |nbatch file|n,
- then you know for sure that the correct copy of |nCOMMAND.COM|n gets loaded.
- The |TSMARTDRV.SYS|T Device Driver
-
- This is the disk cache that comes with DOS versions 4 and up. Ok, it's
- not the greatest disk |ncache|n in the world, at all, but if it's the only
- |ncache|n you've got, it's a good one. You install it, like all device dri-
- vers, with a DEVIC|1E or DEVICEHIGH command in your CONFIG.SYS file. You
- have to have a hard drive, and extended or expanded memory to use it. If
- you have both those types of |nmemory|n, use |nextended|n (unless you have a lot
- more |nexpanded|n |nmemory|n to spare than you have of |nextended|n memory). Because
- it's more efficient. But don't give it more than 2 mega|sbytes|s, because if
- you do, DOS will spend more time looking in the |ncache|n for the data, than
- it would have taken to go ahead and read the data from the hard drive.
-
- Here's the syntax for this device:
- DEVICE=C:\DOS\SMARTDRV.SYS #### /A
- And that assumes, of course, that your |nSMARTDRV.SYS|n file is in the DOS
- directory on your C: drive. The /A switch means that the |ncache|n will go
- into |nexpanded|n |nmemory|n. Without the /A, it will go into |nextended|n |nmemory|n.
- The #### parameter is the size of the |ncache|n in kilobytes. Legal values
- <page down> for more
- SMARTDRV.SYS continued
- are from 128 to 8192, with the default being 256, and that's about as low
- as you should go. If you don't have as much memory as you specified, the
- cache will load anyway, and just use whatever |nmemory|n you do have. Of
- course the DEVIC|1E command has to appear later in CONFIG.SYS than the
- extended (|sHIMEM.SYS|s) or expanded |nmemory|n manager, or else the |ncache|n won't
- have any usable |nmemory|n to go into!
-
- Do not ever, ever, ever, use a disk optimizer (a program that fixes up
- fragmented files) with a |ncache|n active! That includes FASTOPEN, SMART-
- Drive, or any other sort of |ncache|n. If you do, you may as well get out
- your set of BACKUP disks because your FAT is going to get trashed.
-
- Keep your BUFFERS command at 20 or lower when you're using SMARTDrive.
-
-
-
-
-
-
- |TWhat Is DOS?|T
-
- DOS stands for Disk Operating System. It's a bunch of files on a disk,
- that tell the computer how to deal with such things as files, programs,
- disks, and directories. The main parts of DOS, meaning the Hidden files,
- along with the file COMMAND.COM, have to be loaded into the computer's
- memory each time you turn on the power, or else the computer won't know
- how to do anything. As long as you have a proper boo|1t disk, this loading
- of DOS into |nmemory|n is handled for you automatically by a tiny software
- program which is permanently stored in the computer on a ROM chip. Un-
- til DOS is loaded into |nmemory|n, the computer has no idea how to do any-
- thing, other than load DOS into |nmemory|n. Computers are totally stupid
- until a software program tells them what to do. Well DOS is the main
- software program that the computer needs, in order to know how to deal
- with any other software program.
-
- Well that's what DOS is as far as the computer is concerned. But what is
- DOS to you? DOS is what lets you organize your files, and optimize your
- system to make it run the way you want it to run.
- <page down> for more
- What Is DOS? continued
- A file is just the method that DOS uses to store information on a disk.
- All of your programs are made up of files, and all the data you enter in-
- to your programs is stored as files. If you write a letter using your
- word processor, and you save that letter to disk, you have to give it a
- filename, and then your word processor will tell DOS to write your letter
- to the disk, under that filename.
-
- You see, DOS acts as an interpreter between you and the computer, and be-
- tween your word processor or other applications and the computer. DOS
- will let you or your applications create files, move files, copy files,
- rename files, organize files into a directory, and all sorts of great
- things like that. Most of the DOS commands are even pretty straightfor-
- ward as to what they are named. For example, the command you use to copy
- a file to a different location is COPY. The command to erase a file from
- your disk is ERASE. In order to move a file, you use those two commands
- together. First you copy the file to a different location, and then you
- erase the original. DOS doesn't give us a separate MOVE command, so that
- in case something goes wrong with the |nCOPY|n command, the original file
- <page down> for more
- What Is DOS? continued
- won't automatically get deleted. If you receive an error message from
- the COPY command, you can figure out what the problem was, correct the
- problem, and make a good copy of the file, before you erase the original.
-
- Now you have to be careful and always take a look at what you've typed,
- before you hit the <Enter> key, because DOS will do what you say, not
- what you mean. There's a standing joke in the computer world about how
- someone should put a DWIM (Do What I Mean) key onto a keyboard. There's
- another joke about an UNDO key. But those keys don't exist. DOS does
- exactly what you tell it to do, even if that wasn't what you meant to
- tell it, and in most cases you can't undo it after it's been done.
-
- One thing that causes a lot of confusion among new computer users is mix-
- ing up the / and \ keys. They have separate uses, and if you hit / when
- DOS wants to see \, that won't work. The \ (backslash) is for separating
- directory names, and the / (forward slash) is for switch parameters.
-
- DOS lets you customize your system to your own taste, by using the files
- <page down> for more
- What Is DOS? continued
- called CONFIG.SYS and AUTOEXEC.BAT. These are just plain ASCII text
- files that contain commands that you want to have performed every time
- you turn on the computer. There are tons of commands that you can use in
- these two files, to make the computer run the way you want it to run.
- You can also use DOSKEY macros, or a batch file, to make the computer do
- things that you want it to do, for which separate commands don't already
- exist.
-
- There are just so many things that you can do with DOS, that you can't do
- if you don't know how to work with DOS. Lots of people think that it's
- not necessary to know anything about DOS in order to make a computer go.
- Well, that's true, up to a point, but when something goes wrong, those
- people have to call someone else to fix it. People who know DOS don't
- have to do that. In fact, people who know DOS are going to have fewer
- things go wrong in the first place, because they know what to do in order
- to keep things from going wrong. Well, that's the whole point of this
- "book", is that knowing how to use DOS is going to make your computer
- life a whole lot easier, more enjoyable, and more productive. So read
- on!
- PLEASE IGNORE THIS PAGE!
- |TSET|T|fSIMPLY1|f
- |TSHELL|T|fSIMPLY1|f
- |t286|t|fSIMPLY1|f
- |t386|t|fSIMPLY1|f
- |tANSI.SYS|t|fSIMPLY1|f
- |tATTRIB|t|fSIMPLY1|f
- |tAUTOEXEC.BAT|t|fSIMPLY1|f
- |tBACKUP|t|fSIMPLY1|f
- |tCHKDSK|t|fSIMPLY1|f
- |tCMOS|t|fSIMPLY1|f
- |tCOMSPEC|t|fSIMPLY1|f
- |tCache|t|fSIMPLY1|f
- |tDirectory|t|fSIMPLY1|f
- |tEMS|t|fSIMPLY1|f
- |tEnvironment|t|fSIMPLY1|f
- |tExpanded|t|fSIMPLY1|f
- |tExtended|t|fSIMPLY1|f
- |tHIMEM.SYS|t|fSIMPLY1|f
- |tHidden files|t|fSIMPLY1|f
- |tLIM|t|fSIMPLY1|f
- |tMemory|t|fSIMPLY1|f
- |tRAM|t|fSIMPLY1|f
- |tROM|t|fSIMPLY1|f
- |tShareware|t|fSIMPLY1|f
- |tXMS|t|fSIMPLY1|f
- |tXT|t|fSIMPLY1|f
- |tbytes|t|fSIMPLY1|f
- |tcommercial|t|fSIMPLY1|f
- |tconventional|t|fSIMPLY1|f
- |tcurrent|t|fSIMPLY1|f
- |tdefault|t|fSIMPLY1|f
- |thigh|t|fSIMPLY1|f
- |tmacros|t|fSIMPLY1|f
- |tpublic domain|t|fSIMPLY1|f
- |troot|t|fSIMPLY1|f
- |tupper|t|fSIMPLY1|f
- |TEXIT|T|fSIMPLY2|f
- |TFORMAT|T|fSIMPLY2|f
- |tASCII|t|fSIMPLY2|f
- |tBoo|1t Disk|t|fSIMPLY2|f
- |tDisks|t|fSIMPLY2|f
- |tEDLIN|t|fSIMPLY2|f
- |tExecutable|t|fSIMPLY2|f
- |tLow-Level|t|fSIMPLY2|f
- |tParameters|t|fSIMPLY2|f
- |tPower|t|fSIMPLY2|f
- |tRAMdisk|t|fSIMPLY2|f
- |tReplaceable|t|fSIMPLY2|f
- |tShelling Out|t|fSIMPLY2|f
- |tediting keys|t|fSIMPLY2|f
- |tfloppy|t|fSIMPLY2|f
- |TCALL|T|fSIMPLY3|f
- |TCOMP|T|fSIMPLY3|f
- |TCOPY|T|fSIMPLY3|f
- |TDEVICEHIGH|T|fSIMPLY3|f
- |TDEVIC|1E|T|fSIMPLY3|f
- |TDIR|T|fSIMPLY3|f
- |TDO|1S|T|fSIMPLY3|f
- |TFOR|T|fSIMPLY3|f
- |TKEYB|T|fSIMPLY3|f
- |TNLSFUNC|T|fSIMPLY3|f
- |TSHIFT|T|fSIMPLY3|f
- |tDevice|1s|t|fSIMPLY3|f
- |tPATH|t|fSIMPLY3|f
- |TDOSSHELL|T|fSIMPLY5|f
- |TPAUSE|T|fSIMPLY5|f
- |TREM|T|fSIMPLY5|f
- |TRENAME|T|fSIMPLY5|f
- |TSHARE|T|fSIMPLY5|f
- |TUNDELETE|T|fSIMPLY5|f
- |tBoot|t|fSIMPLY5|f
- |tCOMMAND.COM|t|fSIMPLY5|f
- |tReboot|t|fSIMPLY5|f
- |tWildcards|t|fSIMPLY5|f
- |TDRIVER.SYS|T|fSIMPLY6|f
- |TSORT|T|fSIMPLY6|f
- |TTYPE|T|fSIMPLY6|f
- |tCONFIG.SYS|t|fSIMPLY6|f
- |tFAT|t|fSIMPLY6|f
- |tKeyboard|t|fSIMPLY6|f
- |tLogical Drives|t|fSIMPLY6|f
- |tRedirection|t|fSIMPLY6|f
- |tTSR|t|fSIMPLY6|f
- |tbinary|t|fSIMPLY6|f
- |thexadecimal|t|fSIMPLY6|f
- |TEXIST|T|fSIMPLY5|f
- |TIF|T|fSIMPLY5|f
- |tBatch File|t|fSIMPLY7|f
- |tDevice Driver|t|fSIMPLY3|f
- |tPROMPT|t|fSIMPLY6|f
- |TBUFFERS|T|fSIMPLY3|f
- |tfragmented|t|fSIMPLY1|f
- |TERASE|T|fSIMPLY3|f
- |t*.*|t|fSIMPLY5|f
- |TQBASIC|T|fSIMPLY6|f
-