home *** CD-ROM | disk | FTP | other *** search
- DOSUTIL.DOC
- Copyright (c) 1991 by R.P.McCormick
- 79 Rye Street
- Broad Brook, CT 06016
-
- USING DOS UTILITIES:
-
- The following is an attempt to answer some of the questions I have
- received from various users. Since explicit information is contained
- here, Advanced users are excused. This is intended to be very basic.
-
- When you obtain a new utility program for your computer, two related
- questions arise: 1. How to run it, and 2. Where to put it.
-
- 1. There are several ways you can run the program.
-
- A. If the program is in the "current directory", typing the program's
- name runs the program. (see notes 1 & 2)
- In this case, you do not need to add any prefix to the program name
- to run it. For an imaginary program called "PROG", just type
- "PROG" followed by a <CR> (see note 3).
-
- B. If the program is in a directory other than the current one, that
- is, if it is not in the same directory the prompt shows (note 1)
- you may need to type the program's full name, which could include
- the drive prefix and directory name(s) in front of the program's name.
- Example: If you have placed the program in a directory called
- "newstuff" on a floppy in the A: drive, and you were currently
- anywhere on the C: drive, you would type the full program name
- as "A:\NEWSTUFF\PROG", then <CR>.
-
- C. Since this is somewhat awkward, it is generally worth the trouble
- to learn how to make it easier. One very small step in this direction
- would be to "go" to drive A: ( Type "A:" <CR> ), and then change
- the current directory on the A: drive to the directory the program
- is in by using the DOS command "CD". For example, to get to the top
- level while in any directory on the A: drive, type "A:\" <CR>. The
- backslash tells DOS to go to the top level. Then "CD NEWSTUFF" <CR>
- takes you to the directory containing the program. You can always
- do a "DIR" <CR> to verify that it is there. Then, if you want to
- use the program from anywhere on the C: drive, you do not need
- to use the full program name. Only the drive prefix needs to be
- added. Example: "A:PROG" <CR> will run it.
-
- 2. The best place to put utilities.
-
- A. Copying the program to the C: drive is another small but worthwhile
- step. You could put the new program at the top level of the hard
- drive as follows: Go to the directory on A: where the program is,
- and type "copy prog.exe c:\" <CR>. The backslash directs the program
- to c:'s top level. The reason for doing this is that now, the program
- is accessible from anywhere on the system by typing only the program
- name, with no prefixes nor directory names.
-
- B. Placing a large number of utility programs at the top level eventually
- gets messy. My personal preference, which I learned from other more
- experienced people is to create a separate directory to contain all
- my utility programs. I call mine UTILS. I also have a directory
- where I keep all the batches. That is, files with the .BAT suffix.
- This I call BATCH. It is easy to create these by using the DOS "MD"
- or "make directory" command. Go to the top level using "CD\", then
- "MD UTILS" <CR>. After moving (see note 7) the programs into the
- UTILS directory, they will no longer respond to your typing the
- program name without including the directory name as a prefix.
- That is, you would have to type "C:\UTILS\PROG" <CR> to guarantee
- that the program will run from anywhere on your system.
- So there is one other thing that has to be done. That is, you must
- add the directory name "C:\UTILS" to the DOS "PATH". (see note 5)
- after that is done, you will not have to type the drive nor
- directory name again.
-
-
-
- Many programs allow you to enter a question mark or the letter "H" to see
- a help file instead of running the program. You should read the help file
- and any .DOC or README files supplied before running the program.
-
- NOTES:
- 1. Most computers will display the current directory's name as part of the
- prompt. Example: C:\ identifies the "root" or top level directory, while
- C:\DOS means your current directory is called "DOS". I loosely refer to
- this as "being at" the DOS directory. Unfortunately, this feature is not
- built in to all computers. Some merely show what drive you are on.
- Possibly the most useful DOS command is "DIR". Typing DIR <CR>
- (see note 3) will tell you what directory you are in. (Note 4 discusses
- how to make the prompt tell you where you are at.)
-
- 2. All programs have a suffix, typically .EXE, .COM, .BAS, or .BAT.
- So, the example program would be typically listed as "PROG.EXE".
-
- 3. By <CR>, I mean to hit the "Enter" key or "Return" key or whatever
- it is called on your computer. CR stands for Carriage Return.
-
- 4. To make the DOS prompt include the name of the current directory,
- include the following statement in your "AUTOEXEC.BAT" file.
- PROMPT = $p$g
- See note 6 about editing this file.
-
- 5. To add a directory name to DOS "PATH":
- A: If there is no "PATH" statement in AUTOEXEC.BAT add the following:
- PATH = C:\UTILS;C:\BATCH
- B: If there is an existing "PATH" statement in AUTOEXEC.BAT, you can
- add to it, as long as the total length of the line does not exceed
- 127 characters. If the present statement reads "PATH = C:\DOS" for
- example, change it to read PATH = "C:\DOS;C:\UTILS;C:\BATCH".
- Note the use of the semicolon to separate the names.
-
- 6. Modifying the AUTOEXEC.BAT file:
- A. First thing is to look at the existing file. "Go" to the top level
- of the C: drive and use the DOS command "TYPE". You enter
- "TYPE AUTOEXEC.BAT" <CR>. There is the possibility that there is
- no such file. If this is the case, creating one from scratch is
- not all that difficult. (See 6C.) On the other hand,
-
- B. Editing the AUTOEXEC.BAT file can be risky. It is run each time you
- "boot up" the computer. If you mess up this file, things may look
- very unfamiliar and operate strangely until it is straightened out.
- What you need is a good Text Editor. One that operates on ASCII text
- files. WordPerfect is no good for this. It puts all kinds of extra
- codes in the file. I find that trying to use the tools DOS gives you
- is both difficult and cumbersome. I don't know how to use the editor
- they give you. "EDLIN" is it? I would not try to use EDLIN to edit
- a file. It is possible, but I can't really encourage you to do so.
- A couple of editors which I have tried are the Norton Editor,
- Borland's Turbo Pascal editor, and Borland's Turbo C editor.
- They are all no-nonsense editors which can be used to edit
- AUTOEXEC.BAT. What I use is called PC-WRITE which is available
- as shareware through most bulletin boards, or you can write them at
- Quicksoft, 219 First Ave. N. #224, Seattle, WA 98109. They also have
- a smaller version called PC-WRITE LITE which I have never used, but
- have seen highly recommended by people who write for a living.
- You may want to have a friend help you with the editing if you don't
- feel comfortable with it. One possibility is to copy your existing
- AUTOEXEC.BAT to a floppy and have someone at the office or school
- edit it for you.
-
- C. If there is no file called AUTOEXEC.BAT on your computer, you may
- want to create one containing the PROMPT and PATH statements
- mentioned above. This can be done using available DOS tools.
- But before doing that, do a "DIR" <CR> both to verify that you
- are "at" the top level on the C: drive, and that there is no file
- by that name listed. DOS will give no warning that you are
- destroying the original file when you do the following.
-
- At the C:\> prompt, type
- "COPY CON: AUTOEXEC.BAT" <CR>
- "PROMPT = $p$g" <CR>
- "PATH = C:\UTILS;C:\BATCH" <CR>
- <CTRL> "z" <CR>
-
- That last statement means to hold down the "Ctrl" key then press
- and release the "z" key, then release the "Ctrl" key.
- You can view the file you just created using the "TYPE" command.
- You may want to practice the above on a different named file
- to make sure you are doing it right, after which you could
- rename the file from whatever it was to AUTOEXEC.BAT using
- the DOS command "REN" or rename. Example: If the file was called
- "TESTFILE" you would enter "REN TESTFILE AUTOEXEC.BAT" <CR>.
- The statements you entered in AUTOEXEC.BAT do not take effect until
- the next time the computer is "booted". You can hit these 3 keys
- simultaneously to reboot: <Alt> <Ctrl> <Delete>. Or use the "reset"
- button found on some computers, or shut off the power, wait about
- 5 seconds, then turn it back on.
-
-
- 7. There is no DOS "MOVE" command. When you copy a file, for example
- by typing "COPY PROG.EXE C:\UTILS" <CR>, you leave a copy behind.
- To "MOVE" a file you then delete the file at the source. You
- probably do not want to delete the file on the floppy, but if
- you are trying to "clean up" the top level of the C: drive, you
- would type "DEL C:\PROG.EXE" <CR> to erase the file at that
- location.
-