====================================================================== Title: Basic DOS Information - Study and Reference Notes on MS-DOS ---------------------------------------------------------------------- Filename: DOSINFO.TXT Author: Terry Slade, Norman, OK Revision: 03/16/97 First rev: 08/92 ====================================================================== See end of file for Contents. ====================================================================== WHAT IS DOS DOS is an operating system used on PCs. A computer uses an operating system as a foundation to run programs on. Programs are written to run on a particular operating system. Shortly after power-on, the system ROM BIOS loads the operating system, usually from a diskette or hard drive. The operating system remains in memory until the system is powered off. From the beginning of PC history in 1981 until the mid to late 1990s, DOS was the operating system used by almost all IBM-compatible PCs. In 1996 Windows 95 was installed the majority of new PCs. Although WIN95 is really a distinctly different operating system, it includes and sort of runs on top of MS-DOS 7. WIN95 can run DOS programs, switch between GUI (graphical user interface) mode and MS-DOS mode and still includes most previous DOS commands. Some other operating systems are also becoming more widely used on PCs such as Windows NT, OS/2, and variations of Unix. ---------------------------------------------------------------------- LEARNING DOS A thorough knowledge of DOS should be considered essential for any computer technician or any serious computer user, even in the age of Windows, although many people sucessfully use PC's all day every day with little or no knowledge of DOS. The basics of DOS can be learned quickly and easily but there is always more to learn and the more you learn about DOS, the more you can use PCs efficiently. Most of the information in this text is basic DOS, but much of it is more advanced. Different people may find different parts useful. It is meant to be useful as an aid in studying DOS and also as a reference. Many excellent DOS books are available in any large bookstore. The DOS HELP command provides thorough basic reference. DOS 5.0 and older was provided with complete manuals. DOS 6.0 includes a very thin manual and refers to the HELP command for more information. Of course the best way to learn about DOS is to use it and experiment with it on a PC. ====================================================================== FILES, FILENAMES, DRIVES, PATHS, DIRECTORIES, COMMAND PROMPT FILES, FILENAMES, EXTENSIONS All programs and data - that is, everything - on your computer's hard disk and all of your floppy disks is in the form of files. Every program consists of at least one file and may include any number of files. Any document you create with a word processor or a text editor is a file. Worksheets created by spreadsheet programs, pictures created by drawing programs, or any kind of data generated by any application will be in the form of files. DOS itself is just a collection of files. All files must have names and DOS has definite rules as to how these files are named. A filename consists of 1 to 8 characters followed by an optional extension of 1 to 3 characters. The extension is separated from the filename with a period. A filename can use any alphanumeric characters (numbers and letters) and certain other characters, such as: - _ ! @ # $ % ^ & ~ There are certain reserved characters that cannot be used in a filename or extension. These are: . , / \ ; : | < > " [ ] + = ? * Spaces are not allowed in filenames. Here are some examples of valid filenames: F F.E FILENAME FILENAME.EXT ABC-123.12 FILENAME._XT ---------------------------------------------------------------------- DIRECTORIES All files reside in directories. Every hard drive and every floppy drive automatically has one directory called the root directory (or just the root). All other directories are subdirectories of the root or subdirectories of subdirectories, etc. Directories can contain files, subdirectories, or both. The term subdirectory is used in a relative way - this directory is a subdirectory of that directory. All sudirectories are directories, and all directories except the root are subdirectories of other directories. Directories are created to organize files. The directory system is sometimes compared to a file cabinet system. A file cabinet drawer is a drive or volume, directories are file folders, and files are the papers or documents in the folder. Large application programs such as WordPerfect will create their own directory or directories for their files when they are installed. Sometimes we need to create directories ourselves for programs that don't do so automatically or to store documents we have created. There is a special DOS command used to create a directory. This command is MD (Make Directory). It can also be issued as MKDIR. Example: C:\>MD NEWDIR creates a directory called NEWDIR in the root. Directories are named like files: 1 to 8 characters with an optional 1 to 3 character extension. Most filenames include extensions, most directory names don't include extensions. The root directory is indicated by DOS with the backslash character (\). The backslash character is also used to separate directories and subdirectories in a pathname. All files and directories have a pathname which consists of the name and location of the file or directory. Example: c:\parent\child\filename.ext is the full pathname of a file called filename.ext, which is located in a directory called child, which is a subdirectory of a directory called parent, which is a subdirectory of the root directory of drive C:. Directories are sometimes referred to as parent, child, grandparent, etc. ---------------------------------------------------------------------- DIRECTORY TREE The structure of directories and subdirectories on a disk is referred to as the directory tree. To see a graphic representation of the directory tree on disk C:, enter TREE at the command prompt. (DOS versions before 4 will simply list the directories). Example: C:\>TREE will show complete directory tree of drive C: TREE can be used to show a partial tree by specifying the full pathname of any directory. TREE can be used with switch /F to include all files in directories. If a TREE listing is longer than one screen, the command can be used with the MORE filter as follows: TREE | MORE Although you may never need to use the TREE command, it is important to completely understand the concept of the directory "tree" structure. ---------------------------------------------------------------------- SETTING UP A DIRECTORY STRUCTURE It is important to create and maintain a well-organized directory struture in order to make your computer efficient and easy to use (and easy to keep track of). Any program consisting of more than one or two files should be placed in its own directory. As a general rule the root directory should contain only the five or six files that are required by DOS to be in the root directory: COMMAND.COM, IO.SYS, MSDOS.SYS, CONFIG.SYS, and AUTOEXEC.BAT (and WINA20.386 on 386 machines running MicroSoft Windows 3.0). All other files should be placed in appropriate subdirectories. There are occasional exceptions - such as 386SPART.PAR, Windows 3.x's permanent swap file, which must be in the root directory. Subdirectories should be grouped together in an organized way. For instance instead of having twenty different directories in the root for twenty different games, it might be better to have a subdirectory in the root named GAMES and to place the twenty different games directories under the GAMES directory. It is best to name directories with names that help to easily recognize the contents. Directory names are best kept short to save keystrokes when typing in pathnames and to keep the path statement within its 127-character limit. Most large programs install themselves into a default directory. It is standard practice for DOS to be kept in a directory called DOS, in the root of the boot drive (C:\DOS). This is also the directory DOS 4, 5 or 6 will install to by default. It is standard or recommended to keep a directory called UTIL (or UTILS or UTILITY or TOOLS, etc) in the root of the boot drive so that often-used utilities can be kept in the path. This directory is also commonly called BIN, for binary as opposed to text. This is a convention in the Unix world. On systems with a lot of batch files, it is common to place them in a directory called BAT or BATCH and place this directory in the PATH. ---------------------------------------------------------------------- DRIVENAMES DOS assigns letter names to floppy drives, hard drives, CD-ROM drives and certain other devices. A drive name is always a letter followed by a colon. These drivename letters are assigned automatically by DOS and are assigned in a certain order as follows: 1st floppy drive = A: 2nd floppy drive = B: 1st hard drive = C: 2nd hard drive = D: CD-ROM drives, network drives, ramdrives, etc. are assigned first unassigned letter starting with C (drives C: through Z: are possible) Generally, unless special equipment is used, only 2 floppy and 4 hard drives may be present. Tape drives usually do not have a drivename and are accessed only with special tape-backup software, normally provided by the manufacturer. TO CHANGE DEFAULT DRIVE Enter drivename at command prompt. Example: C:\>A: changes default drive from C: to A: new prompt is A:\> ---------------------------------------------------------------------- COMMAND PROMPT Prior to MS-DOS 6.0, the default DOS command prompt was the current driveletter followed by greater-than sign. Example: C> Standard practice is to modify the prompt to include the full location of the current default directory (referred to as the default drive and path). Example: C:\1ST\2ND> indicates full pathname of current directory which is C:\1st\2nd ---------------------------------------------------------------------- PROMPT COMMAND The PROMPT command is used to modify the DOS prompt. To change the prompt to current path and drive, type PROMPT $P$G at the command prompt. This changes the prompt to C:\> which now indicates the current directory, which is the root. Standard practice is to place the line PROMPT $P$G in AUTOEXEC.BAT file, so that the prompt is always set to indicate the current drive and directory followed by a > sign. Entering PROMPT by itself at command prompt changes prompt to default prompt. In MS-DOS 5 and lower, the default prompt is just the drive letter followed by the greater-than sign. Starting with DOS 6.0, the default prompt is $P$G. This means the line PROMPT $P$G, usually found in every AUTOEXEC.BAT file, is no longer needed. ---------------------------------------------------------------------- ENTERING COMMANDS All DOS commands are entered at the DOS command prompt. To enter a command means to type the name of the command and then press the ENTER key. The ENTER key is also referred to as the carriage return (often expressed as ) or just the return key, these terms surviving from typewriter usage. All program files (files with extensions .EXE .COM or .BAT) are executed (run) by entering name (extension unnecesssary) at command prompt. These files are referred to as executable files. In case of duplicate names with different executable extensions, a COM file is executed before an EXE file and an EXE file will be executed before a BAT file. This priority can be overridden by typing in the complete executable filename, including extension. No space is necessary to separate command from command prompt. Command should be separated from any following parameters by a space. Some commands have modifiers called switches or parameters which are separated from the command by a forward slash (a space is often unnecessary but its best to include it). All DOS command names, directory names and filenames can be entered in either upper case or lower case. Although DOS commands are not case- sensitive, other programs often have switches that are case-sensitive. ---------------------------------------------------------------------- TO CHANGE CURRENT DIRECTORY (Working directory) The CD command is used to change directories. CD means "change directory" or "check directory". The CD command can also be entered as CHDIR. CD can also be used to indicate the current directory, useful on a system whose command prompt does not already indicate the current directory. Example: C:\FRUIT>CD APPLES changes current directory to C:\FRUIT\APPLES (prompt changes to C:\FRUIT\APPLES>) Directory must be subdirectory of current directory unless complete pathname is specified. Example: C:\FRUITS\APPLES>CD \TREES changes current directory to C:\TREES (prompt changes to C:\TREES>) Note that since C:\TREES is not a subdirectory of the current directory we must specify its location (the \ indicates that the TREES directory is a subdirectory of the root of the current drive). If we type CD TREES when the prompt indicates we are logged to the directory of C:\FRUIT\APPLES, DOS will display the message "Invalid directory" since the TREES directory is not a subdirectory of the current directory. Full pathname may be abbreviated if specified directory is lower than or parallel to current directory in directory tree. Examples: C:\ABC>CD DEF changes current directory to C:\ABC\DEF C:\FRUITS\APPLES>CD ..\ORANGES changes current directory to C:\FRUITS\ORANGES (the two dots indicate parent directory) CD.. changes current directory to parent of current directory Example: C:\UTILS\ARCHIVE>CD.. changes to C:\UTILS CD\ changes current directory to root directory Example: C:\UTILS\ARCHIVE\ZIP>CD\ changes to C:\ CD by itself asks DOS to indicate the current directoy. This is useful if the PROMPT command has not been used to set the prompt to always indicate the current drive and directory. The current directory can also be called the working directory, the logged directory or the default directory. ---------------------------------------------------------------------- TO REMOVE A DIRECTORY Use command RD (Remove Directory) (Can also be issued as RMDIR) Example: C:\>RD DIRNAME removes directory DIRNAME from root of drive C: Directory must contain no files or sudirectories before RD can be used. Directory removed must be subdirectory of current directory unless full pathname is specified. Cannot remove any directory above current directory in directory tree. ---------------------------------------------------------------------- LISTING CONTENTS OF DIRECTORY WITH DIR The DIR (directory) command is used to display a list of the files and subdirectories in the current or selected directory. Example: C:\UTILS>DIR will show a listing on screen of all files and subdirectories contained within the directory of C:\UTILS In a directoy listing, the period separating filename and extension is replaced by a space. Column next to name shows size in bytes. Subdirectories are indicated by appearing in size column. Next columns show date and time file or directory was created. Full pathname can be specified to list any directory. First two file listings are a period and two periods automatically created in every directory except the root. The period represents the current directory. The two periods represent the parent directory. These files can not be viewed, deleted, or copied. The . and .. notation, indicating current and parent directory, can be used with many DOS commands. A partial list of a directory's contents can be specified by listing filenames or directory names or by using wildcard characters. Example: C:\UTILS>DIR *.COM will list only files with COM extension. Prior to DOS 5.0, the DIR command has only two switches, /W and /P. DIR /P The /P (pause) switch is used to display a large directory one screen at a time. DIR/W The /W (wide) switch is used to display a large directory five columns across instead of the usual one column width. Size, date, and time are ommitted in the DIR/W listing. Prior to DOS 5.0, subdirectories are not distinguished from files. DOS 5.0 introduces several new switches for the DIR command: /A (attribute), /O (order), /S (subdirectory), /B (bare), and /L (lower). /A (attribute) The /A switch shows files with any attributes. In other words, files with the hidden attribute included. (See section on file attributes). /A can be used with parameters to specify that only files with certain attributes be listed. One or more of these letters are placed after the /A and separated from it by a colon: D = directories R = read-only H = hidden A = archive S = system files - = prefix meaning not - can be used with any above /O (order) The /O switch lists files in sorted order - directories first in alphabetical order followed by files in alphabetical order. The /O switch can be used with parameters to specify the sort method. One or more of these letters are placed after the /O and separated from it by a colon: N = alphabetical by name S = by size (smallest first) E = alphabetical by extension D = by date and time (earliest first) G = group directories first - = prefix to reverse order /S (subdirectory) The /S switch displays files in the specified directory and in all subdirectories of that directory. When used with a file specifier, the /S switch can be used to search an entire hard drive or tree to locate a particular file or files. /B (bare) The /B switch tells DIR to list files in bare format - no heading info, summary info, size, date or time. /L (lower) The /L switch tells DIR to show the listing in lowercase. --------------------------------------------------------------------- WILDCARD CHARACTERS The asterisk and the question mark are used in DOS as "wildcard" characters. The asterisk can be used to replace all characters from the beginning of a filename to any following character or all characters from any character to the period (referred to as dot) that separates filename and extension or any character or characters in the extension. Example: to specify various subsets of this set of four files: newpaper.txt oldpaper.txt newpaper.bak oldpaper.bak *paper.txt specifies newpaper.txt and oldpaper.txt new*.txt specifies newpaper.txt new*.* specifies newpaper.txt and newpaper.bak *paper.* specifies all files *.* specifies all files The question mark can replace any single character. Any number of ? can be used in a filename specification (filemask). Examples: paper?.??? specifies paper1.txt, paper2.txt but not paper12.txt paper1?.* specifies paper12.txt but not paper1.txt These two wildcard characters are used when specifying filenames with commands such as DIR, COPY, XCOPY, DEL, or REN to simplify typing in a large list of files or to specify a file when its correct name is not known. The *.* (pronounced star-dot-star) specification is used often to specify all files in a directory. ---------------------------------------------------------------------- PATH In DOS the word PATH has two meanings. A pathname is the location of a file. We may speak of specifying a path to a file. For instance the full pathname of the FORMAT command is usually C:\DOS\FORMAT.EXE. PATH is also a DOS command used to set an environmental variable, known as the PATH or the PATH statement. A command or executable file can only be executed from the directory it is in unless its full pathname is given or unless that directory is in the PATH. Example: if the DOS command FORMAT.EXE is found in the directory of C:\DOS and the C:\DOS directory has not been specified in the path then the FORMAT command can only be executed by entering FORMAT when the current directory is C;\DOS or it can be executed from any directory by entering the fullpathname, C:\DOS\FORMAT, from any directory. If the C:\DOS directory has been placed in the PATH then FORMAT.EXE can be executed from any directory just by entering FORMAT. The default path is no path. Entering PATH at command prompt will show current path setting. Standard practice is to place all DOS files in a directory called DOS and to place this directory in the path. Commonly a directory named UTIL or UTILS is placed in the path and is used to contain various regularly used .EXE and .COM files. Path statement is in the following form : PATH=C:\DOS;C:\UTIL;C:\WP51 with each directory specified by full pathname and separated by a semicolon. A path statement can be specified at the command prompt at any time. Any path statement specified at the command prompt replaces any previously existing path statement. Standard practice is to place the PATH statement in AUTOEXEC.BAT file. The path statement is limited to 127 characters. For this reason it is wise to keep directory names short. You may also need to review your path statemnet in AUTOEXEC.BAT to see if there are directories there that can be removed. Starting with DOS 6.0 the SET command can be used in CONFIG.SYS which means that the PATH statement can be placed in CONFIG.SYS using the format SET PATH= and can be any length. This can be dangerous since some programs may modify AUTOEXEC.BAT during installation and if a new path statement is placed in AUTOEXEC.BAT, it will override the path statement in CONFIG.SYS. The SUBST command is also sometimes used to increase the path statement past the 127 character limit. ====================================================================== COPYING FILES DOS has three commands used to copy files: COPY - copies one or more files from one location to another XCOPY - can copy whole directories with subdirectories DISKCOPY - makes an exact duplicate of a floppy disk DOS 6.0 introduces the MOVE command. Files are commonly copied, moved, renamed, and deleted using a file manager rather than by manually typing in DOS commands. ---------------------------------------------------------------------- COPY Specify sourcefile and destination separated by a space. Include full pathnames unless source and/or destination is current directory. If file of same name already exists at destination, old file will be overwritten by new file. Until MS-DOS 6.2, this overwriting is done without asking for confirmation. The switch /-Y will prompt for permission to overwrite an existing copy of a file. To rename a file while copying: specify a new name with in the destination. To copy multiple files: list consecutively separated by a space. To concatenate (combine) two or more files into one file: separate source files with a plus sign (no spaces). Wildcard characters may be used to simplify copying multiple files. EXAMPLES: To copy one file from root of C: to root of A: C:\>copy onefile.ext A: To copy a file and rename it: A:\>copy onefile.ext c:\misc\newfile.ext To concatenate (combine) two files: C:\>copy file1.ext+file2.ext newfile.ext To copy all files in a directory to the root directory of drive A: C:\REPORTS>copy *.* A: The COPY command seems tricky at first and should be practiced extensively as it is a very important and often used command. ---------------------------------------------------------------------- XCOPY Rules of usage are similar to COPY. Switch /S is used to specify that all specified files are to be copied from current and lower level subdirectories to parallel set of directories and subdirectories at destination. If subdirectories do not exist at destination, XCOPY creates them. EXAMPLE: C:\NOTES>xcopy *.* A: /s Copies all files from directory of C:\NOTES plus all files in directories of c:\notes\new and c:\notes\old to root of drive A:, preserving the original directory structure. XCOPY is provided with eight different switches which give it many powerful options including selective copying of files based on date or attribute. Although you may have no need of most of XCOPY's many features and although it can be a difficult command to learn, you should at least learn to use it's /S switch to copy subdirectories. The /E switch preserves empty subdirectories. XCOPY /A copies only files with A (archive) attribute set on but does not turn attribute off. XCOPY /M copies only files with A attribute set on and turns attribute off. XCOPY works faster than the COPY command because it reads as many files into memory as will fit before it writes them, while the COPY command reads one file, then writes it, then reads another, etc. ---------------------------------------------------------------------- DISKCOPY DISKCOPY makes an exact duplicate of a floppy disk. Since it makes an exact copy it can only be used to copy between the same capacity of diskettes (360K, 720K, 1.2M, 1.44M) Example : C:\>DISKCOPY A: A: copies a floppy disk to another using one floppy drive. Instructions will appear onscreen to prompt for source and destination disks to be inserted at proper times. May take several passes. Since DISKCOPY makes an exact copy including any fragmentation of files and bad sector markings, it is sometimes preferable to use XCOPY. Note that XCOPY will only copy the files, where the DISKCOPY command will also copy any volume label, which may be important on a software installation disk. ---------------------------------------------------------------------- MOVING FILES DOS introduced the MOVE command with version 6.0. EXAMPLE: C:\>MOVE C:\FILENAME.EXT C:\DOS MOVE can also rename a file while moving. Prior to DOS 6, a file would be moved in two steps, by first copying it and then deleting the original. ---------------------------------------------------------------------- DELETING FILES Files are deleted using the DEL (delete) command. ERASE can be used instead of DEL. Full pathnames must be given unless files are in current directory. Wildcards may be used. DEL *.* deletes all files in current directory. All files in a directory can be deleted by specifying a directory-name. DOS 6.0 introduces the DELTREE command, which will delete a directory along with all files in that directory and in any subdirectories. ---------------------------------------------------------------------- UNDELETE The UNDELETE command is new in DOS 5.0. UNDELETE can recover files recently deleted provided no other file has written over the space occupied by the lost file. You are asked to supply the first letter of a file when undeleting it. ---------------------------------------------------------------------- RENAMING FILES Files can be renamed using REN command (can also be issued as RENAME). Specify old name followed by new name. Example: C:\>REN THIS.FIL THAT.FIL renames the file C:\THIS.FIL to C:\THAT.FIL Wildcard characters can be used. Example: C:\MISC>REN *.TXT *.DOC renames all files in current directory with .TXT extensions to .DOC extensions. Files can also be renamed with the COPY or MOVE commands. ====================================================================== PRINTING FILES ASCII text files can be printed using the PRINT command. The PRINT command is a memory-resident program - once you load it to print a file, it stays in memory until the system is rebooted. This enables it to work in the background - a long file can be printed during idle times while you continue to use the PC. Specify file or files to be printed. Example: PRINT FILENAME.EXT The PRINT command does not work with POSTSCRIPT printers. A file created with a text editor may be printed using the PRINT command. Upon issuing the command, the following message prompt will appear onscreen: Name Of List Device [PRN]: Just press the ENTER key and the file should start printing. PRN is a DOS device name and is equivalent to the DOS device name LPT1. If you have more than one printer and they are connected to different ports instead of to a switchbox then you may need to respond to the above prompt with LPT2 or LPT3 to send the output to a different printer. A text file can also be printed with the COPY command. Example: COPY FILENAME.TXT PRN Normally any files created by application programs such as databases, spreadsheets, word-processors, accounting programs, etc. must be printed using the same program they were created with. Application programs include support for various different printers in the form of built-in or installable drivers. Since there are hundreds of printers, most printers can "emulate" one or more popular printers. The manual for any printer should say what printers it emulates. Most printers have two or more emulations which are selected either by setting DIP switches on the printer or by programming the printer by pressing buttons on the front of it. The ASCII code includes a control character that sends a form-feed to the printer. This code can be imbedded in any ASCII text file so that a text file can be formatted to print with page-breaks. Most text-editors will allow you to enter this code into a document by pressing the 1 key followed by the 2 key on the numeric keypad while holding down the ALT key. You must use the numeric keypad (the number keys to the right of the letter keys), not the number keys above the letter keys. And of course the numlock key must be on. If you are viewing this document onscreen as a text file, you can see this form-feed character at the end of this line: The MODE command can be used to cause the PRINT command to print a text file in compressed print. MODE LPT1 132 8 will cause text to be printed in 132 columns and 8 lines per inch. MODE LPT1 80 6 is the default. A standard 8 1/2" by 11" page can hold 66 lines and 86 columns. Most printers will print 80 columns, leaving a 3-column margin on both sides. When setting up a printer, you should align it to center the 80 columns with the 3-column margin on each side. A laser printer will normally print 60 lines per page, leaving a 3 line margin top and bottom while a dot-matrix printer may need to be told how to break up pages. Normally these matters are handled by any application used for printing but it can be useful to know how to control the printing of plain text files. ====================================================================== VIEWING A TEXT FILE A text file can be viewed using the TYPE command. (TYPE FILENAME.EXT) If the file is too long to fit on one screen, it will scroll past quickly until it gets to the last screen. To be able to read any file longer than one screen with the TYPE command you will need to combine it with the MORE filter. The MORE filter causes the output of a command (such as TYPE or DIR or TREE) to be displayed one screen at a time, pausing after each screen until any key is pressed. The MORE filter is used with the pipe character. (Properly speaking, the output of the TYPE command is piped through the MORE filter.) EXAMPLE : TYPE LETTER.DOC | MORE Will display the file LETTER.DOC one screen at a time. (Spaces before and after | character are optional) Most users will find the TYPE command to be completely inadequate for viewing files and will prefer to use some kind of a file-viewing program that allows scrolling forward and backward through a file line by line or page by page. Any directory/file management program should have this ability. The DOSSHELL provided with DOS 4.0 through 6.0 (dropped in 6.2) is a file manager and has a built-in viewer. LIST.COM by Vern Buerg is a popular and widely available shareware program used to view files. It can be used to search a file for a particular string such as a certain word. Directory Freedom (DF.COM) is an excellent shareware file manager. Any text editor can be used to view a text file. DOS provides EDIT beginning with 5.0. Text files are often assigned the file extension TXT, but may have any extension. Most shareware programs include documentation in the form of text files. (Look for something like MANUAL.DOC or anything ending in TXT or DOC) Many programs include text files with names such as READ.ME containing important information on running or installing the program. All batch files are text files. Many configuration files used in DOS and in various programs are text files, such as AUTOEXEC.BAT, CONFIG.SYS, WIN.INI, and SYSTEM.INI. Internet email is all pure text as are all of the messages on the Internet Usenet newsgroups. All of the HTML files on the World-Wide Web are also plain text files. ====================================================================== CREATING AND EDITING TEXT FILES A text editor is the second most basic and important program on any PC (after a good file-manager). Many text-editing programs are available. SLED, BOXER, and QEDIT are excellent shareware text-editors. All versions of DOS include one - EDLIN with older versions, EDIT with DOS 5 and higher. Many programs have text-editing capability built-in, and most word-processing programs can also function as text-editors. A text editor can be used to create and edit text files. You should be very comfortable editing your AUTOEXEC.BAT file. You can use a text editor to create batch files to simplify tasks on your machine. A text editor can be used to write letters and papers. A word-processing program is basically a text editor with many additional features. One difference between a word-processing program and a text editor is that a text editor generally only creates files in pure ASCII text, which can be viewed with any file viewer (including the DOS TYPE command), edited with any text editor (including EDLIN and EDIT provided with DOS), and printed with the DOS PRINT command, while a word-processing program (such as WordPerfect) will usually create files containing various control codes and other characters causing it to be useful as a file only when viewed, edited, or printed using the same program that created it. (Though modern word-processing programs can usually import and export each other's file formats). This document is a text file, created entirely with a text editor (I use SLED). I use text-editors extensively for writing because of the ease of use and the universality of the format. ---------------------------------------------------------------------- EDLIN EDLIN is a very primitive and very difficult-to-use text editor provided with all versions of DOS through 5.0. It was not included in version 6.0. It's chief limitation is that it is a line editor rather than a full-screen editor. In it's day, EDLIN's main usefulness was that it could be found on almost every PC. Unless you want to be a total and fanatical DOS expert, you should have no use for EDLIN. EDLIN COMMANDS: EDLIN NEWFILENAME Returns "New file" with asterisk prompt on next line. EDLIN FILENAME Returns "End of input file" with asterisk prompt on next line. i or I - Insert text press ENTER for blank line press ENTER to end last line Press CTRL-C or CTRL-BREAK to return to prompt. A number preceding i enables new line to be inserted above specified line number. l or L - lists the contents of a file. l or L preceded by line no. or nos. lists that line or lines A range of numbers is separated by a comma. To list one line type it as a range (1,1L) L preceded by one no. lists file starting with that line. Line no. by itself at the prompt means Edit that line. D or d - preceded by a line no. or range deletes that line or lines. E or e - Saves the file ands exits EDLIN. A backup of modified files is automatically created, using BAK extension. Q or q - Quits EDLIN without saving changes. ---------------------------------------------------------------------- EDIT DOS 5.0, 6.0 and 6.2 provide a full-screen text editor called EDIT. EDIT is menu-driven and includes built-in help. (A file named EDIT.HLP must be present to use the HELP option in the editor). Note that the file EDIT.COM in the DOS directory is not the complete editor. This file works together with QBASIC.EXE to provide a modified version of the QBASIC editor. In fact the the DOS editor can be started without the presence of EDIT.COM by adding a switch to QBASIC, starting it like this: QBASIC /EDITOR. EXITING AND SAVING FILES EDIT is exited by pressing ALT-F, and then X (ALT-F opens FILE menu-box, X selects eXit) - EDIT will exit to DOS unless the file has been modified, in which case it will pause before exiting and ask whether the file should be saved. If it is a new file EDIT will ask for a filename. A file can also be saved anytime with ALT-F S. MARKING TEXT Areas of text can be marked and then deleted with the DEL key or copied or moved using the "Clipboard". Begin marking an area of text by holding down the SHIFT key and pressing the left arrow key. Or you can use the right arrow to mark backwards. SHIFT-DOWN-arrow marks a line. SHIFT-CTL-END marks from cursor to end of file. SHIFT-CTL-HOME marks from cursor to beginning of file. PASTING TO AND FROM CLIPBOARD CTL-INSERT copies marked text into clipboard. Previous contents of clipboard are overwritten. SHIFT-INSERT copies text from clipboard. SHIFT-INSERT can be used multiple times to copy the same text until CTL-INSERT is used to paste something else into the clipboard. ---------------------------------------------------------------------- COPY CON The COPY CON command works with all versions of DOS and is useful for creating small text files quickly without using an editor. COPY CON is actually just using the COPY command to copy a file to the console, the display screen. CON is the DOS device name for the console. After specifying a filename with COPY CON, a cursor appears on a blank line. Text may entered, ending each line by pressing the ENTER key. After pressing ENTER to end last line, press the F6 key (or CTL-Z) to place an End-Of-File character under last line. Press ENTER again to return to command prompt. The message "1 file(s) copied" should appear. ====================================================================== FILE ATTRIBUTES DOS files can be assigned any number of four file attributes, indicated by the following letters: A (archive), R (read-only), H (hidden), and S (system). A (archive) Indicates a newly created, copied, or modified file. The A attribute is automatically set by DOS when a file is copied, moved, renamed, created, or modified in any way. The A attribute is automatically removed by DOS when a file is backed up (archived) with the DOS BACKUP command or copied with the XCOPY command. The A attribute can be used to provide selective use of certain commands such as BACKUP and XCOPY. Many other backup programs will make use of the archive attribute. R (read-only) File cannot be deleted or overwritten. Can be assigned to prevent a file from accidental erasure. H (hidden) Files with hidden attribute are not shown in DIR listing and can't be copied, deleted, etc. S (system) The system attribute is normally assigned only to the two DOS hidden system files - IO.SYS and MSDOS.SYS. Attributes are shown, assigned or removed using the ATTRIB command. Example: ATTRIB filename shows attributes of specified file. Attributes are removed with the minus sign and assigned with the plus sign. Example: ATTRIB +A -R filename Assigns A attribute and removes R attribute. ATTRIB works only with A and R attributes in DOS 3.3 and 4.01 ATTRIB works with all four attributes in DOS 5.0 and higher. The DOSSHELL in DOS 4.01 (or higher) can modify all four attributes. Many file management programs can be used to view and modify file attributes easily and will show hidden files in their directory listings. Directory Freedom shows all attributes on every file and can quickly modify them. File attributes are not something that you normally need to be concerned with but it is useful to understand them. For instance you may find that you are unable to remove a directory because there's still a file in it even though you thought you just deleted all files. Maybe the file has a read-only attribute or maybe it has a hidden attribute. These attributes must be removed before a file can be deleted. Note that directories can also have any of the four attributes assigned to them. ====================================================================== BOOTING DOS The process by which a computer loads its operating system is called booting (or booting up). This term derives from the saying "Pull yourself up by your own bootstraps", as the machine uses a part of itself to load a part of DOS which then loads the rest of itself into the machine. When a computer is first turned on, the ROM BIOS performs the POST (Power On Self Test) procedure to make sure everything is working OK. The boot process begins as the ROM BIOS locates the boot program in the boot sector of the boot disk (usually drive C:) which it then loads into RAM. Next the boot program finds and loads the two hidden DOS system files, IO.SYS and MSDOS.SYS (or something similar depending on DOS version). Next the boot program looks for the optional DOS file CONFIG.SYS, and if found carries out its instructions. Next COMMAND.COM is located and loaded and control is passed to it. COMMAND.COM then looks for the optional DOS file AUTOEXEC.BAT and if found, carries out it's instructions. Finally the DOS command prompt appears. (Unless AUTOEXEC.BAT has specified that a program such as Windows or a menu program is run upon boot-up, in which case the DOS prompt will not be seen until that program is exited.) REBOOTING The computer always tries to boot up when it is first turned on. Sometimes rebooting the machine is necessary when the computer "hangs" or "locks up", refusing to respond to any commands. Rebooting is sometimes the best way or only way to remove TSR (Terminate and Stay Resident, also called memory-resident) programs from memory. A computer can be rebooted in three ways: 1. Turn the machine off and back on. (Always wait at least five seconds or until machine is completely quiet before restarting). 2. Press the RESET button on the front of the system unit. (Some machines don't have a reset button). 3. Press the CTRL, ALT, and DELETE keys simultaneously. (This is known as a soft boot or a warm boot). If a hung machine doesn't respond to CTRL-ALT-DEL then try the RESET button, if still no response turn machine off and back on. BOOT DISK A PC always tries to boot up from drive A first. If no boot disk is found in drive A, it will attempt to boot up from drive C. Most systems with hard drives have DOS installed on the hard drive and boot up automatically whenever the system is turned on. Older systems must boot up DOS from a floppy disk and then load any other programs from floppy disks as needed. A system that boots up from the hard drive can be booted up from a floppy disk instead anytime. Note that only drive A can be used as a boot drive, not drive B. You will notice that the lights on all of your drives come on whenever you first power the system on. This is the POST (Power On Self Test). Next you will notice drive A being accessed again. This is checking for a floppy disk. If a diskette is found in drive A it will be examined for an operating system. If it is not a bootable disk you will receive the message "Non-system disk or disk error, replace and press any key when ready". If the disk is bootable DOS will load from the floppy, bypassing the system files and configuration files on the hard drive. It should be considered essential to always have a boot disk available in case any problems develop on the hard drive which cause it to no longer boot up. One common problem is that COMMAND.COM will accidentally get deleted from the root directory. It is then necessary to boot up from a floppy disk and replace the file. Other system files may become deleted or corrupted or you may have a virus problem or someone may even erase the entire drive. There are many reasons why you may someday need to have a boot disk. There are two ways to create a boot disk. One is to format a diskette using the /S parameter, meaning system. Example: FORMAT A: /S will format the diskette and then copy the sytem files IO.SYS, MSDOS.SYS, and COMMAND.COM onto the diskette, making it bootable. (With DOS 6.0 another file, DBLSPACE.BIN is also copied. This allows a doublespaced drive to be accessed.) The other way is to use the SYS command. Example: C:\>SYS A: will copy the system files onto the disk in drive A. To use the SYS command a diskette must already be formatted and should not have any files on it. The system files IO.SYS and MSDOS.SYS must be the first files on a disk in order for it to be bootable. ====================================================================== BATCH FILES A batch file is an executable text file containing DOS commands, program names, and special batch file commands, which are executed line by line. Since batch files are text files, they are easily created or modified with any text editor. Writing batch files is actually programming in the simplest programming language, DOS batch language. All batch files are given the extension BAT, which is how DOS recognizes them. Batch files are used to simplify operations which are performed often by combining a set of commands into one file, executed by a single command. DOS batch language commands, like other DOS commands, are not case-sensitive. CTRL-C or CTRL-BREAK will halt a batch file and produce the message - "Terminate batch job (Y/N)?" Answering Y returns to the DOS prompt. Answering N continues execution of the batch file. All of the following commands as well as any other DOS commands or program names must appear at the beginning of a line in order to be recognised. A batch file may contain blank lines - they are ignored but may make a long or complex batch file easier to read. Though the DOS batch language is quite useful it has many limitations. Though many packages of utilities to enhance the DOS batch language are available, there is often an advantage to sticking with a universal standard. DOS batch language commands: @ - The ampersand (@) at the beginning of a line suppresses display of current line (DOS 3.3 & higher) ECHO - Echo (display) the current line to the screen. Must be followed by at least one blank space. ECHO. - Displays a blank line onscreen. ECHO ON - Turns on echoing of commands to the screen. Each line in the batch file is displayed onscreen as it is being executed. ECHO OFF - Turns off echoing of commands to the screen. @ECHO OFF - This combination command is found at the beginning of most batch files and prevents the commands in a batch file from being displayed onscreen as they are executed. PAUSE - Halts a batch file and produces message: "Strike any key when ready" (before DOS 5.0) or "Press any key to continue" (MS-DOS 5.0 and after). To halt a batch file without producing these messages onscreen, the output of the command can be redirected to the NUL device (also called the empty device) like this: PAUSE > NUL This line would commonly be preceded by a message echoed to the screen using the ECHO command. REM - (REMIND or REMARK) If REM appears at the beginning of a line, that line will not be processed. Commonly used to insert comments or remarks into a batch file or to temporarily disable a line for troubleshooting purposes. : - A colon by itself at the beginning of a line causes that line to be ignored. Any 8 characters (or less) preceded by a colon (with no space in between) at the beginning of a line is a "label" which can be used by the GOTO command. GOTO label - Skip to line beginning with specified label. (The colon is not included) . CLS - Clear the screen %0-9 - REPLACEABLE PARAMETERS %0 is automatically the name of the batch file as entered on the command line %1 is the first parameter typed at the command line after the batch file's name. This string will replace the string %1 wherever it appears in the batch file. SHIFT - Allows more than 10 replaceable parameters CALL batchfile - Executes specified batch file from within current batch file and returns to processing current file when called file is done. (DOS 3.3 and higher) (before DOS 3.3 use COMMAND /C ) IF - Tests 3 conditions - (optionally issued as IF ... THEN) Can be issued as IF NOT ERRORLEVEL Whether 2 strings are equal (is case sensitive) IF %1 == STRING GOTO EQUAL IF "%1" == "" GOTO EMPTY (IF %1. == . GOTO EMPTY) IF FILE EXISTS - IF EXIST FILENAME, IF NOT EXIST FILENAME FOR..IN..DO FOR %% IN () DO %%variable - one letter or number - takes on value of each item in set (items, commands, filenames) CHOICE - (New in DOS 6) - Used together with the errorlevel command to allow user input for branching in a batch file Refer to DOS HELP for more details on Batch file commands. ====================================================================== AUTOEXEC.BAT and CONFIG.SYS AUTOEXEC.BAT and CONFIG.SYS are DOS's configuration files. They are found in the root directory of the drive that a PC boots up from. DOS executes both files at bootup if they are found in the root of the boot drive (normally C:\ on drive C:, the first hard drive, or A:\ on drive A:, the first floppy drive). After DOS loads itself (MSDOS.SYS, IO.SYS and COMMAND.COM) into memory, it executes CONFIG.SYS, followed by AUTOEXEC.BAT. AUTOEXEC.BAT is executed one line at a time, as all DOS batch files are. The last line commonly launches a menu program or a user interface such as Microsoft Windows, otherwise the command prompt appears. Both AUTOEXEC.BAT and CONFIG.SYS are plain text files - they can be created or edited with any text editor (such as EDIT provided with MS-DOS 5 and 6). AUTOEXEC.BAT is a DOS batch file. Any DOS commands, program names or DOS batch commands can be used in AUTOEXEC.BAT. Only a few special commands can be used in CONFIG.SYS. Normally AUTOEXEC.BAT and CONFIG.SYS are created when DOS is installed onto a system's hard drive. Some customization of these files is usually necessary to adjust for the particular hardware and software used on a particular system. AUTOEXEC.BAT and CONFIG.SYS are commonly modified by the installation or setup programs run when installing new software programs or hardware. These two configuration files are very important and since they are often unique to a particular system, back-up copies should be kept in another directory of the hard drive and also on floppy disk. Deletion or improper modification of AUTOEXEC.BAT and/or CONFIG.SYS is a very common problem. AUTOEXEC.BAT AUTOEXEC.BAT is a special batch file that DOS looks for during the boot process. It must be located in the root directory of the boot disk. AUTOEXEC.BAT would normally always contain a line to set the PATH and a line to set the PROMPT. Standard practice is to set the prompt to include the current drive and path (full pathname of current directory) by including the line: PROMPT = $p$g The path statement should always include the DOS directory (usually C:\DOS). AUTOEXEC.BAT on an XT class machine (which has no battery to retain correct date and time) should contain the command DATE on one line and the command TIME on another line. This will cause DOS to ask for the current date and time to be entered upon booting up. Names of programs such as TSRs can be included to automatically load or run. The last line in AUTOEXEC.BAT file can cause a menu program or Windows or WordPerfect or any program to be executed upon booting up. Some common lines in AUTOEXEC.BAT: @ECHO OFF - Suppresses display of lines to screen as they are executed PROMPT $P$G - Sets command prompt to the standard prompt, which indicates the current drive and directory, followed by a greater-than sign. (C:\> indicates root directory of drive C.) PATH=C:\DOS;C:\BAT;C:\UTIL - This is a PATH statement. Limited to 127 characters. This line is commonly modified by application installation programs. SET TEMP=C:\DOS - Sets the DOS directory as the temporary directory used by programs which need a place to put temporary files and that look in the environment for this variable. It is smarter to create a directory such as C:\DOS\TEMP and set it as the TEMP directory so that any files that accumulate can be easily deleted. DOS 5 needs this variable set in order to use piping or redirection. Windows needs a TEMP directory and will create a directory called TEMP and add the line SET TEMP=C:\WINDOWS\TEMP if it does not find a TEMP variable already set. C:\MOUSE\MOUSE.COM - Loads a mouse driver. A mouse can work in Windows without a mouse driver (Windows loads its own when it starts up) but a DOS program requires a mouse driver to be loaded before a mouse can be used. Some mouse drivers are loaded as device drivers in CONFIG.SYS C:\DOS\MSCDEX.EXE - Loads Microsoft CD-ROM Extensions - necessary for any CD-ROM drive to work in DOS. C:\DOS\DOSKEY - A very useful tool provided with DOS 5 and higher - saves a command history and allows direct editing of command-line. C:\DOS\SMARTDRV /X - Loads SmartDrive, a disk cache provided with Microsoft DOS and Windows. SET DIRCMD=/A/O/P - A special environmental variable that controls the default options on the DIR command. New in DOS 5. CONFIG.SYS CONFIG.SYS is mainly used to load device drivers which alter the way in which the operating system interacts with hardware such as memory, scanners, CD-ROM drives, SCSI devices, etc. Some common lines in a CONFIG.SYS file: DEVICE=C:\DOS\HIMEM.SYS - loads the extended memory manager provided with DOS to allow access to memory over 1MB. DOS=HIGH - Loads the memory-resident part of DOS into the HMA (1st 64K of extended memory) HIMEM.SYS must also be loaded. DEVICE=C:\DOS\ANSI.SYS - provides extended control over the screen and keyboard. Commonly used by anyone who calls a lot of BBS systems. INSTALL=C:\DOS\SHARE.EXE - SHARE prevents the same file from being opened by more than one program (or by the same program more than once at a time). Some programs require or recommend loading SHARE. In DOS versions previous to 5.0, SHARE must be loaded if the hard drive is larger than 32MB. SHARE can also be loaded in AUTOEXEC.BAT. DEVICE=C:\DOS\SETVER.EXE - new in DOS 5.0. This line appears by default when installing DOS 5.0, 6.0 or 6.2. SETVER provides compatibility for some older programs that are looking for a particular DOS version. STACKS=9,256 - this line is added by Windows installation BUFFERS=25 - Specifies size of disk buffers. Not needed with if using SmartDrive. FILES=50 - Specifies number of files that can be opened at once. Default in DOS 6 is FILES=10. 50 or 60 is a safer number. SHELL=C:\DOS\COMMAND.COM /e:1024 /p - increases size of environment SET COMMAND AND THE ENVIRONMENT The SET command is used to store variables in a special area of memory known as the environment. Issuing SET alone on the command-line displays a listing of all variables currently set in the environment. The PATH, PROMPT, DATE, and TIME variables can all be set using their own names without SET. Any other variable can be set using the SET command. Variables are commonly set in the AUTOEXEC.BAT file. Beginning with DOS 6.0, the SET command can be used in the CONFIG.SYS file. The environment has a default size. The size of the environment can be enlarged using the SHELL command in CONFIG.SYS. If the DOS error message "Out of environment space" is encountered, the following line should be placed in CONFIG.SYS: SHELL=C:\DOS\COMMAND.COM /E:1024 /P ====================================================================== DOS VERSIONS The DOS VER command can be be used to identify the version of DOS currently running on a PC. Just type VER at the command prompt. MS-DOS 6.22 is the current version of MS-DOS but 3.3, 4.01, 5.0, 6.0 6.20, 6.21 are all in wide use and any of them may even be considered "current", even though outdated. DOS 3.3 was released in 1987. Some people consider 3.3 to be the ideal operating system for an XT-class machine as it takes up a smaller amount of disk space and RAM memory space than later versions. It is also considered to be very reliable, having proven itself over a long period of time. Any version of DOS previous to 3.3 should be considered obsolete and should be upgraded to at least 3.3. 4.0 was released in 1988 and is often considered to be bug-ridden and larger than necessary. It did introduce some significant new features including the DOSSHELL and the end of the 32 MB partition limit for hard drives. 4.01 corrected most known bugs in DOS 4.0. MS-DOS 5.0 was announced and released June 11, 1991 and quickly became one of the largest-selling software packages ever. It is the first DOS version that could be bought as a stand-alone package (previous versions were supposedly only to be sold with a computer system), the first to be supported by Microsoft tech support, and also the first to be offered as an "upgrade version". This upgrade version does not include a bootable disk, so it must be installed on a machine which already has another version of DOS on it. Actually this can be circumvented by simply booting up off of a boot disk of any version of DOS, including 5.0, and proceding with the installation. A bootable OEM (Original Equipment Manufacturer) version was also provided to computer makers, supposedly only to be sold with a computer system, but was widely available. MS-DOS 5.0 was also widely available through major channels in many "bootleg" OEM versions under various generic-sounding names. MS-DOS 5.0 introduces many new features, including HELP for all commands, a much improved DOSSHELL, and DOSKEY, which stores a command history, enables command-line editing and provides for DOSKEY macros ("batch files" stored in memory to run fast). The files in the original release of MS-DOS 5.0 are dated 4-09-91 with a time stamp of 5:00a. A second release (still called MS-DOS 5.0) is dated 11-11-91 with a time stamp of 5:00a. The second release fixes a bug in CHKDSK and UNDELETE that can cause data loss on certain sizes of hard drives. The second version of 5.0 is known as MS-DOS 5.0a, though the VER command will still report just 5.0. An Application Note, PD0646, available on Microsoft's BBS (206-936-6735) explains this in more detail. The file PD0646.EXE is a self-extracting ZIP file containing the technical note and also the fixed versions of CHKDSK.EXE and UNDELETE.EXE. OEM versions of MS-DOS 5.0 may have different time and/or date stamps. MS-DOS 6.0 was released on 3/10/93 and introduces many new features. Memory management is improved and a new MEMMAKER program is included to automate this process. DoubleSpace is included as an on-the-fly disk compression program similar to Stacker. A new DELTREE commmand allows the deletion of a directory and all subdirectories below it. An anti-virus program has been licensed from Central Point (makers of PC Tools). The BACKUP command has been retired and replaced with a full-screen program called MS BACKUP which is actually Norton Backup, licensed from Symantec.DEFRAG is an adapted version of Norton Utilities' SPEEDISK, which is used to defragment the hard drive. The HELP introduced with DOS 5.0 has been retained and renamed as FASTHELP and a new hypertext help system is included for the HELP command. Files are dated 3-10-93, time stamp is 6:00a. MS-DOS 6.2 - released 11/93. MS-DOS 6.2 Step-Up is available free from MicroSoft BBS or for $9.95 as a diskette in computer stores. Step-Up can only upgrade from MS-DOS 6.0. The complete Upgrade version (which upgrades from any DOS version) is packaged either with a special edition of DOS for Dummies or with Microsoft documentation. Fixes some problems with DoubleSpace and Smartdrive, adds some new commands. Programs which list file and memory sizes, such as DIR, MEM, and CHKDSK, now use a comma to separate thousands, millions, etc. Files are dated 9-30-93, time stamp is 6:20a. 6.1 was skipped by Microsoft to avoid confusion with IBM's DOS 6.1. DOSSHELL has been dropped. MS-DOS 6.21 (MS-DOS 6.2 minus DoubleSpace) - late Feb. 1994 - released following court decision against Microsoft in suit by Stac electronics alledging Microsoft copied code from Stacker. Microsoft was ordered to pay Stac $130 million and to discontinue selling DoubleSpace. No disk- compression program was released with MS-DOS 6.21. Files are dated 02-13-94, time stamp is 6:21a. MS-DOS 6.22 (MS-DOS 6.21 with new compression program - DriveSpace) Last release of MS-DOS before WIN95. Files are dated 05-31-94, time stamp is 6:22a. DOS 6.1 (PC-DOS 6.1) is IBM's version of MS-DOS 6. No disk compression program is included. No longer intended to be used on IBM systems only, IBM's DOS is now a competitor to MS-DOS. IBM also released a version of DOS 5 - probably kind of an OEM version of MS-DOS 5. PC-DOS 6.3 - released by IBM in early March of 1994. Includes SuperStor disk compression licensed from AddStor. Novell DOS 7 - 1994 - The first update to DR-DOS since Novell purchased it from Digital Research. A special version of Stacker (3.1) is included. Includes Personal Netware, Novell's followup to Novell Lite, a peer-to-peer networking system. Also available as an upgrade to DR-DOS 6. IBM PC-DOS 7 -1995. Includes Stacker 4.0. Release dates of older MS-DOS versions: 1.0 August 1981 1.1 May 1982 1.25 June 1982 2.0 March 1983 2.0 March 1983 2.1 October 1983 2.11 December 1983 3.0 August 1984 3.05 November 1984 3.1 March 1985 3.2 December 1985 3.3 April 1987 4.0 July 1988 4.01 August 1988 DOS versions before 6.0 were issued under various OEM licenses with various date and time stamps. Versions from various manufacturers such as Compac, Epson, Tandy, and Wyse were sometimes altered to fit different types of system designs. ====================================================================== BACKING UP THE HARD DISK The term BACKUP could refer to several different types of procedures used to protect data. Any floppy disk considered valuable, such as an original copy of a commercial program should be copied using the DISKCOPY command to provide a backup copy. Any files on a hard drive may be copied onto floppy disks to provide backup copies. And it is wise to have a copy on floppy disks of any program that is installed on a hard drive so that it could be reinstalled if something should go wrong with it. The best protection against any disaster is provided by a full backup of the hard drive. This backup could be kept on floppy disks, tape, or even another hard disk. Many computer users are very lazy about backing up their hard drives. It should be considered essential to keep a full backup of the hard drive at all times unless you wouldn't mind losing all of the data you have stored. There are many reasons why you could lose your hard drive. All hard drives will eventually fail and have to be replaced. Various problems can occur which may result in the corruption of FAT tables or just corruption of any particular files. Of course there is always the possibility of accidental erasure of all or part of a disk by yourself or by someone else. And despite the best protective measures a virus could cause any amount of damage. There are many programs available to perform backups. If you have a tape drive it is probably best to use the software provided with it. All versions of DOS through DOS 5.0 have included the BACKUP command. DOS 6.0 includes the MSBACKUP program which is actually Norton Backup licensed from Symantec. Fastback and Central Point Backup are a couple of popular commercial programs. Archivers such as PKZIP and ARJ can also be used to create reliable multi-diskette backups. The DOS BACKUP command is used to make a backup copy of the entire contents of a hard drive including the complete directory structure so that it can be restored completely to its original state if needed. The DOS BACKUP command stores backed up files on floppy disks in a format that cannot be accessed except by the RESTORE command. It fills up each disk in the backup set completely, chopping files off when a disk is full and continuing them on the next disk. If the directory on a BACKUP disk is viewed, it will be seen to have only two files - one large file containing the file or files backed up onto it and one control file that DOS uses to keep track of the contents of the disk. These files can be retrieved only by using the DOS RESTORE command which can either be used to restore the whole set or any particular files or directories. The BACKUP and RESTORE commands are not always compatible across different versions of DOS. It is wise to keep a boot disk which includes the BACKUP and RESTORE commands. To BACKUP a hard drive: C:\>BACKUP C:\*.* A: /S backs up all files on drive C to a set of floppy disks on drive A. The /S specifies that files in all subdirectories below the root will be included. The BACKUP command does not backup the system files, IO.SYS and MSDOS.SYS. An INCREMENTAL BACKUP can be performed to back up files daily or weekly so that a complete backup does not have to be done every day or week. When the /M switch is added to the above command only files with the ARCHIVE attribute will be backed up. The archive attribute is automatically turned off on any file as it is backed up with the BACKUP command. The archive attribute is automatically turned on whenever a file is created, copied, moved, edited, or altered in any way. To RESTORE a set of backup disks: C:\>RESTORE A: C:\ /S restores a set of backup disks to a hard drive. MS BACKUP is supplied with DOS 6.0. This is actually Norton Backup licensed from Symantec. This program is supplied in both DOS and Windows versions. If you install the Upgrade version of MS-DOS 6.0 you are given the option to install DOS, Windows, both, or neither. You can always go back later and install either of these by inserting DISK1 and typing SETUP /E. The first time the MSBACKUP command is executed, you are asked to allow the program to run a compatibility test to make sure that the program will work properly on your system. Just follow its instructions. You will be asked to provide 2 diskettes of like media for this test. After the test you should reformat these diskettes. The full-screen interface is meant to be easy to use but MSBACUP can be confusing. Often the TAB key is used to move from one option to the next. If you wish to backup the entire drive you will need to hit the space bar after selecting the "Source Drive " option. There is more information on this program in the DOS 6.0 manual. If you are using DOS 6.0 and would prefer to use the BACKUP command (which is no longer supplied with DOS 6.0) you can simply copy the MS-DOS 5.0 version of this file to the DOS directory. In order for this to work you must have SETVER loaded in CONFIG.SYS. There was a coupon in the back of the DOS 6.0 manual that could be sent in to obtain BACKUP and other commands dropped from DOS 6.0. These files may be available from Microsoft through WWW or FTP. DOS 6 does include the RESTORE command so that any backups from previous DOS versions can still be restored. ====================================================================== FLOPPY DISKS AND FLOPPY DISK DRIVES SIZES There are four sizes of floppy disks (disketes) in current use: 3.5" Double-Sided, Double-Density (DSDD, 720K) 3.5" Double-Sided, High-Density (DSHD, 1.44MB) 5.25" Double-Sided, Double-Density (DSDD, 360K) 5.25" Double-Sided, High-Density (DSHD, 1.2MB) A new 3.5" floppy with a capacity of 2.88MB is still not widespread. I sometimes refer to the double-denstiy disks as low-density but they are properly called double-density. All of these disks are double- sided. Single-sided 360K disks were used long ago. You probably will never see a single-sided disk drive but single-sided disks are still sold. They usually are actually double-sided disks that are guaranteed to be good only on one side. Some people buy them to save a few pennies and use them as double-sided disks. This is of course not recommended. Often boxes are labeled with higher capacities, such as 1.6 MB on a box of 1.2 MB 5.25" disks. This refers to the unformatted capacity of the disk (of course the disk can not be used until it is formatted). The formatting process reserves some space which is used by DOS for the BOOT SECTOR and for the FAT tables. Also different types of systems, such as the Macintosh, will format diskettes differently, such that they may have different capacities and will be incompatible with DOS systems. Some manufacturers add more confusion by assigning product numbers such as M2D or 2SDD to disks which should be clearly marked as DSDD 360K, etc. Floppy disks are also correctly called diskettes or just floppies or just disks. 5.25" floppies are also called minifloppies and 3.5" floppies are also called microfloppies. 8" floppy disks were used in some microcomputers before the introduction of the PC. It is common to refer to the various types of floppy disks just by their capacity (360K, 1.2Meg ,etc.). High-density drives can read and write to low density disks but low- density drives can not read or write high density disks. Some people format low-density disks as high density to save money. I have heard that this may work with 3.5" disks, although I wouldn't recommend it and it does involve melting a hole in the disk so the high-density drive will accept it. 5.25" disks should always be properly formatted and used correctly. A high-density drive will automatically format a high-density disk as high-density but will need to be told to format a low-density disk as low-density. There is one exception to the rule of a low-density disk being usable by either low-densiity or high-density drives. If a low-density 5.25" disk has been written to by certain low-density drives and then overwritten in a high-density drive, the disk can no longer be read by a low-density drive. This is because a low-density drive writes a track on the disk twice as wide as that written by a high-density drive. So a 360K drive will see two signals, one inside the other, if it tries to read a disk that has been written to by a 360K drive and then overwritten by a 1.2MB drive. 3.5" disks do not have this problem. HOW TO IDENTIFY DISKETTE CAPACITY 720K diskettes and 1.44M diskettes are identical in appearance except for an extra hole in the upper left-hand corner of a 1.44M disk (viewed metal side down). This hole is similar in size to the write- protect hole in the right-hand corner. An optical sensor in the floppy disk drive determines whether a diskette is 720K or 1.44M by the presence or absence of this hole. Usually a high-density (1.44M) diskette will have the "HD" logo stamped on the upper right-hand corner (viewed with metal-side up). Often there is also a manufracturers brand and size info stamped on the metal. 360K and 1.2M diskettes are identical in appearance except for the presence of a hub reinforcement ring around the center hole of the disk media. Also the media of a 360K diskette is brown in color and the 1.2M disk media is black or dark-gray. ---------------------------------------------------------------------- FORMATTING FLOPPY DISKS All disks must be formatted before use (unless you buy preformatted diskettes). Use these DOS commands to format diskettes: FORMAT A: (or B:) Formats a high-density disk in a high-density drive or a double-density disk in a double-density drive. FORMAT A: /4 Formats a 360K (5.25" double-density) disk in a high-density (1.2MB) drive. FORMAT A: /F:720 Formats a 720K (3.5" double-density) disk in a high- density (1.44MB) drive. FORMAT A: /T:80 /N:9 Formats 720K disk in high-density drive under DOS 3.3. When prompted for a volume label you can just press . The /U switch is recommended if using DOS 5 or 6 - this performs an "unconditional" format, which means that it will just format the diskette as previous DOS versions would do. If the /U parameter is not used, DOS will attempt to determine if the diskette has ever been formatted and if so will save some of the information on it in such a way as to allow the diskette to be unformatted. On an unformatted diskette the FORMAT command will take a significantly longer time if the /U parameter is not specified. The /S switch is used to make a diskette bootable by automatically transferring the DOS system files during the format. These files are IO.SYS, MSDOS.SYS and COMMAND.COM. Older versions of DOS will not transfer COMMAND.COM - it will need to be copied separately with the COPY command. The DOS 6 SYS command will also transfer the hidden file DBLSPACE.BIN. Under MS-DOS 6.2 it is faster to specify the capacity of a diskette even if it is the default. Examples: FORMAT A: /U/F:1.2 Formats a 1.2MB diskette in a high-density drive. FORMAT A: /U/F:1.44 Formats a 1.44MB diskette in a high-density drive. Remember you can always type FORMAT /? if you forget the specific syntax. (Only under DOS 5.0 and higher). If defects are found in the media of a diskette during the formatting process, it is best to just dispose of the diskette. A diskette suspected of having media defects can be checked with CHKDSK or SCANDISK or a utility such as Norton Utilities' Disk Doctor. An undocumented switch, FORMAT /AUTOTEST, skips the beginning and ending prompts and skips the summary. Sometimes used in batch files since it requires no interaction. ---------------------------------------------------------------------- VOLUME LABEL Every hard disk and every floppy disk has a volume serial number automatically assigned to it during the format process. In addition, a volume label can be specified during the format process. This label and serial number can be viewed at any time using the VOL command. The LABEL command is used to assign, change, or view a volume label. The volume label and serial number are also displayed in every directory listing. When formatting a diskette you are asked to assign a volume label. Normally there is no need to assign one, so we would normally just press ENTER at that point. Many software installation programs make use of volume labels during installation from floppy disks. This can cause a problem if a program is being installed from disks copied from originals by just copying the files rather than using the DISKCOPY command, which copies all the files on a diskette and transfers the volume label . ---------------------------------------------------------------------- WRITE PROTECTION OF FLOPPY DISKS Both 3.5" and 5.25" diskettes are provided with a write-protection mechanism. When a diskette is write-protected, files can be copied from it but cannot be deleted and no new files can be copied to the diskette. To write-protect a 5.25" floppy disk, cover the notch cut into the upper right-hand corner of the disk. "Write-protect tabs" are often provided with new diskettes. Electical tape or other non-transparent tape can also be used. To write-protect a 3.5" floppy disk, uncover the hole on the upper right-hand corner of the diskette. (Note that this is the opposite of 5.25" disks.) The write-protect hole on a 3.5" diskette is covered and uncovered by sliding a built-in plastic tab over the hole. This tab is sometimes removed from factory copies of commercial software to prevent accidental erasure. ====================================================================== DEFRAG DEFRAG is a new command in DOS 6.0. It is actually a special version of SPEEDISK from the Norton Utilities, licensed from Symantec by Microsoft. DEFRAG and SPEEDISK are examples of defragmentation programs - also called disk optimisers. When files are first copied onto an empty hard disk or floppy disk, they take up space starting from the beginning of the disk. If a newly loaded hard disk is half full, the first half would be full and the second half would be empty. From this point on its not that simple. As files are deleted from a disk, holes appear. When new files are copied onto a disk, they fill the holes starting from the beginning of the disk. A large file may actually occupy several disconnected sections on a disk. After a period of use, a hard drive may have many files that are "fragmented". This increases the time it takes for DOS to read and load files from the drive.It can be useful to run a program such as DEFRAG on a regular basis. Such programs generally can report the amount of fragmentation present on a disk. All hard disks will be fragmented to some extent, a small amount of fragmentation is no big deal. ====================================================================== INSTALLING DOS MS-DOS 3.3 After partitioning the hard disk with FDISK and formating with FORMAT C: /S (/S transfers the two hidden system files), copy COMMAND.COM to the root. Make a directory called DOS and copy all files from DOS disks to DOS directory. Create AUTOEXEC.BAT and CONFIG.SYS. MS-DOS 4.01 Same as 3.3 or use the SELECT utility. It is common for DOS 4.01's automatic installer, SELECT, not to work on many systems. MS-DOS 5.0 Available both as an upgrade version and as an OEM version. The upgrade version is not bootable, but can be installed on a new system by booting up from any DOS boot disk. Both versions must be installed using the automatic installation program, called SETUP. The factory disks contain compressed files. Individual files can be copied from the diskettes and decompressed using the EXPAND command. Files in which the last character of the extension has been replaced with the underline character are compressed. Upgrade version will require that you insert 1 or 2 "uninstall" diskettes to be used in the event you wish to uninstall. MS-DOS 6.0 Must be installed using SETUP program. Installation disks contain compressed files. Available both as upgrade and as OEM. The upgrade version is not bootable. Upgrade will ask whether to install DOS, Windows or both versions of Undelete, Anti-Virus, and MS Backup Upgrade version is not bootable but can be installed on a new system by just booting up from a DOS 5 or DOS 6 (or any version) floppy disk Upgrade version will require that you insert 1 or 2 "uninstall" diskettes to be used in the event you wish to uninstall. OEM version will boot up and install from scratch on a new system. OEM will install DOS and Windows versions of Undelete, Backup, and Anti-Virus but you must rerun SETUP (SETUP /E) to configure Windows for these programs after Windows has been installed. Additional info on MS-DOS 6.0: Default AUTOEXEC.BAT: @ECHO OFF PROMPT $p$g PATH C:\DOS SET TEMP=C:\DOS Default CONFIG.SYS: DEVICE=C:\DOS\SETVER.EXE DEVICE=C:\DOS\HIMEM.SYS DOS=HIGH FILES=30 SHELL=C:\DOS\COMMAND.COM C:\DOS\ /p Disk space required for full installation (varies): Windows & DOS: 7.3 MB NO Windows: 5.5 MB MS-DOS 6.2 Available both as upgrade and as OEM. The upgrade version is not bootable. Must be installed using SETUP program. Also available as STEP-UP which can upgrade only 6.0 to 6.2. Installation disks contain compressed files. ---------------------------------------------------------------------- UNNECESSARY DOS FILES Normally, unless space is problem, a complete installation of DOS would be allowed. Many older systems may be equipped with 40MB or smaller hard drives and it may be useful to trim down the size of the DOS directory. The MS-DOS 5.0 manual lists files that can be deleted from most systems. These files are used for international support and can usually be safely deleted: *.CPI, COUNTRY.SYS, KEYB.COM, KEYBOARD.SYS, PRINTER.SYS, NLSFUNC.EXE, DISPLAY.SYS, and GRAFTABL.COM. Also, the RECOVER command is commonly deleted as it is considered dangerous. With DOS 6, you may wish to delete files used by DoubleSpace, MS Anti-Virus, MS Anti-Virus for Windows, MS Backup, and MS Backup for Windows, if you are not using these programs. ---------------------------------------------------------------------- FORMATING/PARTITIONING HARD DRIVE Before a new hard drive can be used it must be prepared in two steps: 1. PARTITIONED using the DOS FDISK command. 2. FORMATTED using the DOS FORMAT command. On very old hard drives (MFM or RLL), a low-level format is done before partitioning the drive. This may also be called initializing or preformating. Modern IDE and SCSI drives are low-level formatted at the factory. Most drive manufacturers provide special defect- management software for their drives, but this would not normally be needed. FDISK is used to create one or more DOS partitions on the drive. The FORMAT command prepares the hard drive for use. Usually the /S switch is used to transfer the system files at the time of formatting so that the hard drive can be made bootable. The system files can also be transferred using the SYS command. It is wise to have a boot disk containing the FORMAT, FDISK, and SYS commands. ---------------------------------------------------------------------- FDISK FDISK is the utility provided with DOS for partitioning hard drives. Partitioning a hard disk defines areas of the disk to be used by operating systems as volumes. In DOS, each volume is assigned a drive letter. A disk must be partitioned with FDISK before it can be formatted even if the disk is to be left as one volume. FDISK is menu-driven and is normally started by just typing FDISK. If more than 1 hard drive is present, FDISK will display a fifth option on its main menu to change the currently selected drive. Selecting options 1 (Create DOS Partition) or 3 (Delete Partition) will result in loss of data. Options 2 (Make Partition Active), 4 (Display Partition Information), and 5 (Change Current Fixed Disk Drive) are not destructive. Differences in FDISK in different DOS versions: MS-DOS 2.x - First DOS version to support hard drives. Max partition size - 16MB. MS-DOS 3.2 - Max partition size - 32MB No extended partitions supported. MS-DOS 3.3 - Max partition size - 32MB First DOS version to allow extended DOS partitions. Max number of partitions - 24 (C: through Z:) MS-DOS 4.x - Max partition size - 2GB Max number of partitions - 24 MS-DOS 5.x - Same as DOS 4 MS-DOS 6.x - Same as DOS 4 Under DOS, the first physical drive must be the boot drive. The first physical drive must contain a primary DOS partition and the primary partition must be the first partition on the drive. A drive can have only one primary DOS partition. The partition must be active in order to boot. Only partitions on drive 1 can be made active. Only drive 1 has to have a primary partition. Additional drives may be defined either as primary or as extended partitions. In addition to or instead of a primary partition, a drive may also have one extended partition. All volumes in extended partitions must further be defined in FDISK as logical DOS volumes. DOS through FDISK assigns drive letters first to all primary partitions in order, starting with the letter C, and then to all logical volumes in extended partitions. Drive letters A and B are reserved for floppy drives. Existing Partitions must be deleted with FDISK before new partitions can be defined. FDISK /MBR is an undocumented parameter that will create a new Master Boot Record. It is sometimes used to remove boot-sector viruses. This is not always a good idea - some viruses, such as Monkey, relocate the procedure should be non-destructive to data on the drive. FDISK /STATUS - displays partition information without starting FDISK. The first sector on the hard drive, sector 1, head 0, cylinder 0, contains the master partition boot record. This 512-byte sector contains the partition loader and the partition table. At bootup, the BIOS loads the partition loader, the partition loader loads the bootstrap loader for the bootable partition and the bootstrap loader loads the operating system. ---------------------------------------------------------------------- DOSSHELL AND OTHER FILE MANAGERS The DOSSHELL is a combination file manager, menu system and task switcher. The DOSSHELL program was introduced in DOS 4.0 and greatly improved for DOS 5.0. It was included with MS-DOS 6.0 but dropped from MS-DOS 6.2. Probably DOSSHELL was seen as far less important since most PCs were running Windows by that time. A file manager is a program that provides a menu-driven interface to simplify the use of DOS commands in managing files. It provides an easy way to list files in directories, navigate through the directory structure, view the contents of files, edit files, copy, delete, move, rename files, etc. A file-manager is the most important and useful program to have on a PC. A number of commercial file-managers are available, such as XTREE, QDOS, the Norton Commander and PC Tools' PC Shell. There is a file manager (called File Manager) built into Windows. Many shareware file managers are also available. My favorite file-manager, the best I have seen, is Directory Freedom (DF.COM) by Gordon Haff. It is distributed as shareware and is widely available on BBS systems under the name DF461.ZIP. The DOSSHELL is actually very awkward as a file manager, in fact it is the worst I have seen (of dozens), but since it is provided with DOS it is good to be familiar with it, as it may be the only file manager present on some PC's. ====================================================================== MEMORY MANAGEMENT Memory management is one of the most difficult areas of the PC to learn about. It is kind of a lost art since the advent of Windows 95, but is a very important subject when dealing with DOS. First we need to understand RAM. RAM is an acronym meaning Random Access Memory. When we speak of a PC's memory we are talking about RAM. When DOS boots up (which should happen automatically when a PC is powered on), part of DOS loads into memory and stays there. When a program is started, it loads into RAM. When that progam is exited, it unloads from memory. Another program can then be started, which will also load into RAM and unload itself when we exit the program. There is a special kind of program which loads into memory and stays there until the system is turned off. (Memory is always completely cleared whenever PC is turned off or rebooted). These programs are called TSRs. TSR means Terminate and Stay Resident. TSRs are also called memory-resident programs. The parts of DOS that load into memory at bootup are memory-resident - they are always occupying some of the PC's memory. Older PC's were supplied with 256K or 512K of RAM. 1MB is the minimum amount most 386 or 486 motherboards can run with. If using Windows 3.x, 2MB is minimum, 4 to 16MB preferred. RAM is measured in bytes, kilobytes (KB), and megabytes (MB). A byte is 8 bits. A bit is a binary digit, a 1 or 0, the smallest unit we can work with in the computer world. We normallly always group bits into bytes. A Kilobyte is about 1000 bytes (actually 1024). A Megabyte is about one million bytes (actually 1024 KB or 1,048,576 bytes). A PC has several different types or areas of memory. The first 640K is called CONVENTIONAL memory. The next 384K is called UPPER or RESERVED memory. Everything above 1MB is called EXTENDED or XMS memory. The first 64K of extended memory is called the HMA or HIGH MEMORY AREA. On older PCs the memory above 1MB may be available only as EXPANDED or EMS memory. On PC's with XMS (extended memory), any amount of this can be converted into EMS (expanded memory) using an EMS emulator. Normally any RAM on a memory expansion card is EMS (expanded) memory and requires its own driver to be loaded, while any RAM plugged directly onto the motherboard (DIP, SIPP, or SIMM modules) can be XMS (if over 1MB) Most normal programs can only use conventional memory. Normally progams cannot access upper memory and only programs specially written to do so (such as Microsoft Windows) can use extended memory. This means that in the simplest cases we must be able to fit DOS and all needed TSR's into 640K and still have enough room to load any program we need to run. When investigating and troubleshooting memory-management issues, the main tool to use is the MEM command, introduced with DOS 4, greatly improved in DOS 5, and improved again in DOS 6.0. The best way to use this command is to issue it as follows: MEM /C | MORE. This will give you a listing of all programs currently in memory, indicating the amount of RAM occupied by each and also indicating the total and free amounts of all of the different types of memory that are available on the system. It is easier to pay attention just to the numbers in parenthesis (decimal). It is useful to create a batch file called MM.BAT containing just the line MEM /C | MORE so you can just type MM to view the contents of memory. If you have memory beyond 1MB on your system, it cannot be used unless an extended memory manger is present. DOS and Windows are supplied with the HIMEM.SYS extended memory manager. QEMM and 386MAX are a couple of popular commercial alternatives. These extended memory managers will convert the available extended memory into XMS memory, which is the specification for accessing extended memory in DOS. The MEM command may show that a system with 4MB has 3MB of extended memory but 0MB is available. This is beacuse all of this extended memory is "owned" by HIMEM.SYS. XMS memory may be listed separately. If some of it is not available this is probably because SMARTDRIVE is using some of it. HIMEM.SYS is loaded by placing the line DEVICE=C:\DOS\HIMEM.SYS in CONFIG.SYS, normally as the first line. Starting with DOS 5.0, most of the memory-resident part of DOS can be loaded into the HMA by placing the line DOS=HIGH in CONFIG.SYS. This will require HIMEM.SYS or some other extended memory manager to be loaded first. On most systems it is possible to load some TSR's into UPPER memory by using EMM386.EXE. This is an expanded memory emulator which will allow any amount of extended memory to be converted into expanded memory, which is another type of memory that some programs may require. To use EMM386 to gain access to UPPER memory the lines DEVICE=C:\DOS\EMM386.EXE NOEMS and DOS=UMB must be placed in CONFIG.SYS. The NOEMS parameter means that we want to use EMM386 to access UPPER memory but not to convert extended to expanded. If we needed to use some of our extended memory as expanded we would use the RAM parameter instead of NOEMS but should still gain access to UPPER memory as long as we include the line DOS=UMB, which can also be combined with DOS=HIGH like this: DOS=HIGH,UMB. Once we have set up CONFIG.SYS to allow access to UPPER memory we can use the DEVICEHIGH command in CONFIG.SYS instead of DEVICE to load device drivers. DEVICEHIGH can not be used with HIMEM.SYS or EMM386.EXE. We can also use LOADHIGH or LH in AUTOEXEC.BAT or at the command line to load TSR's into upper memory. This process may require a lot of trial and error to determine which programs will load into upper memory and what order will allow the most programs to fit. The MS-DOS 5.0 manual has a very good explanation of memory management overall and includes all the details needed to configure the system. DOS 6.0 introduces a new command - MEMMAKER which will attempt to determine automatically what the optimal configuration would be for your system and will make the appropriate changes to AUTOEXEC.BAT and CONFIG.SYS. EMM386 should ideally not be used unless necessary as it may actually slow down certain areas of the PC's performance, although it is standard to load it on most systems. HIMEM.SYS and EMM386 are supplied with Windows 3.0, DOS 5.0, Windows 3.1, and DOS 6.x. The most current versions present on your system should be used. (In the examples above, the line DEVICE=C:\DOS\HIMEM.SYS could also be DEVICE=C:\WINDOWS\HIMEM.SYS.) As a general rule, system configuration should be kept as simple as possible. Rather than trying to fit all kinds of TSR's into available RAM, the need for any particular TSR should be questioned. Normally a mouse driver is needed for DOS programs. A CD-ROM drive requires a device driver and MSCDEX (Note that MSCDEX can be loaded anytime from the command prompt, so it can be left out of AUTOEXEC.BAT and loaded only when the CD-ROM drive is needed). ANSI.SYS may be needed for some communucation programs used to call BBSes with a modem. SMARTDRV is a disk cache supplied with DOS and Windows and can be considered optional, though preferable. Other third-party disk cache programs are used as well. SETVER should be loaded in CONFIG.SYS. If using a network, network drivers may need to remain in memory. So there may be a number of TSR's that need to load in to memory. The more TSR's loaded, the more chances of TSR's conlicting with each other and with other programs. One solution to dificult memory management situations is to use more than one set of AUTOEXEC.BAT and CONFIG.SYS files. They can be renamed manually or with a batch file or can be managed by various multi-boot programs. DOS has a built-in mulitiple boot option starting with 6.0. ====================================================================== DOUBLESPACE Stacker has been one of the best-selling software programs for several years. It is an "on-the-fly" compression program. It compresses all files on a hard drive so that the capacity of the drive is increased to as much as double. Although this is a very popular program and thousands of people use it with no problems, it is very complex and thousands of other users have experienced all sorts of trouble. There are several other such programs on the market, such as ADDSTOR and NEWSPACE. It is wise to avoid the use of such programs. Due to the popular appeal of this type of program Microsoft has developed DoubleSpace, which is provided with DOS 6.0. Again many people use this program with no problems and many others have not been so lucky. The chief source of problems with DoubleSpace has been due to its interaction with SmartDrive, the disk cache program provided with DOS and Windows. To prevent some of these problems it is recommended to turn off the write cache on all hard drives. (See section on SmartDrive). Once a drive has been DoubleSpaced, there will be 40K less memory available and it is not easy to undo the DoubleSpace - generally the drive must be backed up, reformatted and reloaded. Some of the problems with doublespace are fixed with an update to DOS 6.0. DOS 6.2 is available as a patch which modifies some of the files in DOS 6.0 or the entire DOS 6.2 package can be bought. This update was released on NOV 1, 1993. Doublespace and other such programs will also slow down a systems performance - especially a slower system. As a general rule, if you need more drive space you should buy a larger hard drive. If you must use such a program Stacker is considered superior to Doublespace. Stacker version 3.1 was released specifically to work with DOS 6.0. Stacker has since released version 4. ====================================================================== SMARTDRIVE (SMARTDRV) Smartdrive is a software disk cache which is provided with DOS 4.0 and higher and with Microsoft Windows 3.0 and higher. It is optional although the SETUP programs for Windows and for DOS 6.0 and 6.2 will install it by default. Older versions are called SMARTDRV.SYS and are installed as a device driver in CONFIG.SYS. Newer versions are called SMARTDRV.EXE and are installed as a TSR in AUTOEXEC.BAT. In some cases a line also appears in CONFIG.SYS to install the double-buffering feature. Typing SMARTDRV at the command prompt will display the current status of Smartdrive - which drives are cached. Each floppy drive and hard drive can have write caching or read caching separately enabled or disabled. It is recommended to disable write-caching on all drives. Beginning with DOS 6 this is the default and a new switch, /X, is provided which disables all write-caching. Prior to DOS 6 write- caching is enabled on hard drives by default and is disabled by placing just the drive letter after the line which loads Smartdrive in AUTOEXEC.BAT. (SMARTDRV C to disable write caching on drive C:). You can always type SMARTDRV /? to display all usage options. With Smartdrive loaded and write caching enabled on hard drives you may notice that whenever you copy files on the hard drive the access indicator light comes on about 5 seconds after the copy is done. This shows us that the data has not actually been copied yet. SmartDrive holds onto the data for a few seconds before copying it. This is dangerous because if you reboot the system or turn it off before the cache has been flushed, you may lose data. This is also problematic with software installation programs that modify AUTOEXEC.BAT and CONFIG.SYS and then reboot the system. This is also the source of some problems when using both DoubleSpace and SmartDrive. These are the reasons why Microsoft changed the default insallation of Smartdrive to turn off all write caching. Most of the benefits of a software disk cache are achieved by the read cache so there is little performance loss by disabling write caching. ====================================================================== MSD MSD is Microsoft Diagnostics, a thorough diagnostic utility included with MS-DOS 6.0 and 6.2 and with Windows 3.1. MSD identifies hardware and software configuration. It is included primarily as an aid to Microsoft personnel when troubleshooting problems over the phone. It is an interesting program to explore. MSD is not considered as good as other standard diagnostic programs. ====================================================================== HELP The HELP command was introduced in MS-DOS 5.0. Typing HELP at the command prompt under DOS 5 will give several screens listing all DOS commands with a brief (1-line) description of each. The message "For more information on a specific command, type HELP command-name" is displayed. HELP followed by a command-name displays a screen or two of very brief info on usage of command. This same usage information can be displayed by typing /? after any DOS command-name beginning with DOS 5.0. In DOS 6.0 the HELP command launches a hypertext help system with more information (though still brief). Meant to replace the printed manual. DOS 6.0 introduces the FASTHELP command which is the same as the HELP command in DOS 5.0 - several screens of one-line descriptions of DOS commands. ====================================================================== SUMMARY OF ESSENTIAL DOS COMMANDS Internal commands are part of the COMMAND.COM file and are available anytime at the DOS prompt, since COMMAND.COM is always loaded. External commands are separate files, normally located in the DOS directory. INTERNAL COMMANDS DIR shows files & subdirs in current or specified directory CD change directory, (CD\ for root, CD.. for parent) MD make directory RD remove directory DEL delete specified file or all files in specified dir TYPE view contents of file REN rename files COPY copy, concatenate, duplicate files VER indicates DOS version CLS clears screen TIME shows system time, sets system time DATE shows system date, sets system date PROMPT sets command prompt PATH specify directories to search for executable commands VOL show volume label of disk EXTERNAL COMMANDS XCOPY copy groups of files including subdirectories FORMAT prepare hard disks or floppy disks for use FDISK prepare a hard disk for formatting PRINT prints files - useful only for ASCII text files BACKUP backs up contents of hard drive RESTORE restores backed up files SYS makes disks bootable TREE shows directory structure CHKDSK shows disk size, memory size, other disk info SCANDISK replaces CHKDSK in 6.2 MEM shows memory usage SORT alphabetize dir etc. : (DIR | SORT) FIND locates specified text in file LABEL change volume label of disk DISKCOPY make exact copy of same size disk DISKCOMP compare two disks ATTRIB reveal, change file attributes MORE display a screen at a time (TYPE FILENAME | MORE) MSBACKUP Microsoft Backup (Norton Backup) new in DOS 6.0 MEMMAKER automates memory management - new in DOS 6.0 HELP Help with DOS commands - new in DOS 5, hypertext in DOS 6 FASTHELP new in DOS 6.0 - same as HELP in DOS 5.0 DEFRAG defragments files on hard drive (Norton SPEEDISK - DOS 6) DELTREE Deletes specified dir and all subdirs. New in DOS 6.0 MSD Microsoft Diagnostics ASSIGN (dropped in DOS 6 - use SUBST instead) SUBST assigns a path to a drive letter MODE configures hardware ports DEBUG a program debugger with many uses ===================================================================== FUNCTION KEYS The keys labeled F1 - F12 are called function keys. The functions that these keys perform can be defined differently in different programs. Some programs (such as WordPerfect) make extensive use of the function keys while other programs may not use them much or at all. At the DOS command prompt these keys have specific functions defined by DOS. F3 - copies all characters from the preceding command to the command line. (This is equivalent to pressing the UP ARROW if DOSKEY is loaded, but will retrieve only one previous command.) If you have DOSKEY loaded, some additional keys are available. The UP arrow key displays the preceding DOS command, and if pressed repeatedly, will display as many of the preceding commands as it can fit in DOSKEY's command-history buffer. The size of this buffer can be adjusted. F7 displays the contents of the stored command-history buffer in a numbered list. ALT-F7 clears the command-history buffer. Beginning with DOS 6.0 some new functions are available. Pressing F5 (or the SHIFT key) upon bootup, while the message "Starting MS-DOS" is displayed, will cause both CONFIG.SYS and AUTOEXEC.BAT to be ignored. Pressing F8 at bootup will allow you to "step through" the lines in CONFIG.SYS and AUTOEXEC.BAT one at a time. In DOS 6.0 this is limited to the CONFIG.SYS file. MS-DOS 6.2 adds the capability to step through AUTOEXEC.BAT as well. A new command is also available in CONFIG.SYS. SWITCHES= /N disables the use of the F5 and F8 keys during bootup. SWITCHES= /F disables the 2-second pause and the display of the "Starting MS-DOS" message. It is possible to redefine the functions of the function keys using the ANSI device driver. ====================================================================== WINDOWS In the PC world when we say Windows we are usually talking about Microsoft Windows, a popular graphical user interface (or GUI). Microsoft Windows runs on top of DOS and provides an "environment" for other programs to run in. Most DOS programs operate in "text mode": the screen is addressed as a matrix of 2000 rectangles - 25 rows by 80 columns. In "graphics mode" the screen is addressed pixel by pixel (dot by dot). Standard VGA graphics is 640 by 480 pixels - 300,000 separately addressable dots. Super VGA is 800 by 600 pixels - 480,000 separately addressable dots. Windows is always in graphics mode. This enables the use of small pictures or icons which can be selected with a mouse. This type of interface can be very friendly and easy to use compared to the DOS prompt at which commands must be entered. The last version of Windows 3.x was Window for Workgroups 3.11. Although Windows 95 prettty much replaced Windows 3.x in 1996, Windows 3.x is still in wide use. Older versions are obsolete (especially 3.0) and should be upgraded to 3.11. Since Windows is always in graphics mode, it will run much slower than DOS programs except on more powerful systems. It also uses a lot of RAM (memory). Windows 3.1 will run on a 286 but not on an XT. A 386SX is really the minimum practical system and a 486SX would be preferred as a minimun. 2MB of RAM is required but 4MB is a recommended minimum. A fast video card such as an accellerator card or a local bus video card is recommended. Windows itself can take 10MB of drive space and Windows applications such as Word for Windows can take up to 15MB or more. For this reason a Windows system needs a large hard drive. Regular DOS programs can be run under Windows using Windows as kind of a menu system but it is preferable to run DOS programs from the DOS prompt. Many applications are available in Windows versions as well as DOS versions. A Windows application can not be run from the DOS prompt, it must be run under Windows. All Windows applications have certain properties in common. Once you learn to use one Windows program you know much of what you need to know to use any Windows program. A chief advantage of Windows is its use as a multi-tasker - allowing more than one program (DOS or Windows programs) to be loaded into memory at once and allowing the option to switch among them easily - or even to run them side by side in different "windows". INSTALLING WINDOWS Windows 3.1 is installed by inserting Disk 1 of the installation diskettes, logging to that floppy drive, and typing SETUP at the DOS prompt. (It is sometimes also installed from CD-ROM or from a directory on the hard drive to which the contents of the diskettes have been copied). The setup program will "read" the system and ask you to confirm that it has correctly identified your hardware. You are given the option of EXPRESS or CUSTOM setup. I usually use the custom option so that I can specify that Windows installs itself into a directory called WIN instead of the default WINDOWS (in the interest of keeping the length of the PATH statement in AUTOEXEC.BAT under control). During the installation you are asked to choose your printer from a list of supported printers. If your printer is not listed you may need to obtain a Windows printer driver from Microsoft's web site, ftp site, or BBS or from the printer manufacturer. You can also check the printer manual, which should list alternate choices for printer drivers. You can always skip this step and go back anytime to install a printer driver. Choose PRINTERS from the CONTROL PANEL. Any number of printers can be installed into Windows. Only one is the current default. Once a printer has been installed in Windows, it is available for use by all Windows applications that have a print option. If you are using a Super VGA video adapter then you may need to install drivers for it into Windows. These drivers are supplied by the manufacturer. Its a good idea to copy the diskettes that came with the card onto a directory on the hard drive both for backup and for ease of installation. Most manufacturers maintain web sites or BBSes from which current drivers can be downloaded. Most Windows programs install into Windows by choosing the RUN option from the FILE menu and typing A:\SETUP or A:\INSTALL. 386SPART.PAR 386SPART.PAR is a "swap file" created by Windows during the process of installation. This file is used by Windows to swap programs onto disk if it runs out of memory so that they can be retrieved quickly. This file is only used by 386 or higher systems running Windows in enhanced mode. Windows Setup will sometimes create a rather large swap file. It is always found in the root directory of the drive where Windows is installed. This file has the Hidden and System file attributes. The size of the swap file can be changed from Windows by selecting the Virtual Memory button in the 386 Enhanced icon in the Control Panel. The 386 Enhanced icon appears in the Control Panel only if Windows is currently running in enhanced mode. WINA20.386 WINA20.386 is a file included with MS-DOS 5.0, 6.0, and 6.2. It is placed in the root directory during installation. This file is needed ONLY if you are running Windows 3.0 (not 3.1) in enhanced mode AND you have a 386 or higher CPU. VBRUNx00.DLL If you encounter a Windows program that won't run and gives you a message saying that it cannot find VBRUN100.DLL or VBRUN200.DLL or VBRUN300.DLL, this is a Visual Basic program and requires that the Visual Basic Runtime Library be present. Versions 100, 200, and 300 are not interchangeable or backwards compatible. To make these programs run, you must obtain the specified file (VBRUN100.DLL, VBRUN200.DLL, or VBRUN300.DLL and place it in the Windows System directory (usually C:\WINDOWS\SYSTEM). These files are widely available online. FONTS Beginning with version 3.1 Windows supports Truetype Fonts. Fonts are installed through the CONTROL PANEL. Truetype fonts are scalable to any specified size. Installed fonts are available to any Windows application. A Truetype font consists of one file with the extension .TTF. When a Truetype font is installed in Windows, a file of the same name but with the extension .FOT is created in the Windows SYSTEM directory. If the TTF file is not in the Windows SYSTEM directory, the FOT file will point to its location. VERSIONS Windows 3.11 released 12/31/93 file dates WIN3.11 updates 5 core files and includes updated drivers The updated core files are available separately as a "refresh" to update WIN31 to WIN311. Download the file WW0981.EXE from Microsoft Download Service Current drivers are available from Microsoft Download Service. Windows 3.1 released 4/6/92 file dates 03-10-92 time stamp 3:10a 6x1.44 7x1.2 Windows 3.00a released 10/31/90 file dates Windows 3.0 released 5/22/90 file dates Windows for Workgroups WFGW 3.1 WFWG 3.11 file dates 11-01-93 time stamp 3:11a TROUBLESHOOTING WINDOWS Many Windows problems are solved by updating drivers - video drivers, printer drivers, sound drivers, etc. These drivers are obtained from the manufacturer. Many drivers are available from Microsoft through their web site, FTP site, or BBS (Microsoft Download Service (206)936-6735). Microsoft maintains a database of technical articles called the Microsoft Knowledgebase. If the mouse becomes unusable in Windows you can use the keyboard instead. ALT-F4 exits from Windows. Switching to a different mouse may require using a different Windows mouse driver. If a video driver problem prevents you from being able to see the screen well enough to change drivers using the Windows Setup icon, you can always run Windows setup from DOS by typing SETUP while logged to the WINDOWS directory. Many problems are solved by editing the WIN.INI or SYSTEM.INI files. Type WIN /? for a list of command line options to use in troubleshooting Windows. ====================================================================== NETWORKS (LANS) LAN - Local Area Network There are two main types of LANs - Peer-to-peer and Client-server. Peer-to-Peer A group of PC's connected together so that each can access contents of all. Lantastic by Artisoft is a popular peer-to-peer network operating system. Client-server One PC is either a dedicated or a non-dedicated file-server, from which attached client PC's access shared data. Novell Netware is the dominant client-server network operating system used on DOS PCs. Network Drives Normally when a PC is connected to a network, it has access to additional drives beyond the usual A:, B:, C:, and D: assigned to local floppy drives and hard drives. Drives on the file server or other PCs may be accessed across the network and will be assigned DOS drive letters. Issuing the Novell MAP command at the DOS prompt will show a list of available drives on a PC connected to a Novell network. Network Devices One reason to connect PCs together in a network is to allow them to share devices such as printers or CD-ROM drives. Network Drivers For a PC to work on a network, it is attached to the network by both hardware and software. The hardware consists of a special network card installed in the PC and the cable connecting to it. The software consists of one or more network driver programs, loaded into memory either upon bootup or whenever the network is joined. Network hardware and software can be very complex and is usually installed maintained by professional network administrators. ====================================================================== ASCII, HEXADECIMAL, BINARY All files on a DOS computer are either program files or data files. Program files have extensions of either .COM, .EXE, or .BAT. These files are also called executable files. An executable file is executed by typing its filename at the command prompt, which will cause it to execute, (or run), a program. Data files contain information that is used or created by program files. Some data files are text files (or ASCII files) which, when viewed using a file viewing program such as the DOS TYPE command or Vern Buerg's LIST.COM, will be seen to contain letters, numbers, and punctuation - ASCII text only. A program file will be seen to contain not only normal text characters but also various other strange-looking characters and symbols. There are a total of 256 characters which make up the ASCII code. All normal text characters are included in the lower 128 characters of this code. The upper 128 characters are sometimes called the IBM character set. These 256 characters can represent the 256 binary values from 00000000 to 11111111 or the 256 hexadecimal values from 00 to FF or the 256 decimal values from 0 to 255. Digital operatons are discrete, they have only two conditions, such as on and off or 0 and 1. Analog operations are continous, they have infinite conditions. Computers use digital operations to do all of their computing work. Deep in the workings of the machine, everything is digital, manifested by two different voltages: +5 volts and 0 volts. The binary number system, consisting of two digits, 1 and 0, is ideally suited to the digital world. A binary digit is called a bit. Eight bits equals one byte. For various reasons a byte is a convenient unit to use in working with computers. Due to its digital nature, a computer can only understand binary numbers - 1's and 0's. To make things easier for programers, the 256 values that can be represented by eight bits are sometimes represented by 2 digits of HEX (hexadecimal). The hexadecimal numbering system uses the leters A, B, C, D, E, and F in addition to the numbers 0-9 in order to represent 16 values with each digit. To take things a step further, two digits of hex can be represented by one digit of ASCII code (a character). The binary numbers used as instructions by the computer can be called machine code and the hex equivalents can be called hex code. So when you are looking at a file with a file viewer, the ASCII code you are seeing actually represents binary numbers, one byte per ASCII character. There are also programs such as the DOSSHELL view option, Norton utilities DISKEDIT, and PC Tools file editor, which will show hex code on the left side of the screen and the equivalent ASCII code on the right. ====================================================================== PROGRAMMING LANGUAGES Every program file that you could ever have on your machine was written in one computer programming language or another, although you generally can not determine what that language is. That is because, after the program was written, it was compiled using a special program called a compiler. Each language has a compiler which works only with programs written in that language. A compiler converts a program from the language it was written in to pure machine language, resulting in a file with a COM or an EXE extension. Programming languages are just a technique of simplifying the process of writing instructions for the computer. The first level up from machine language is assembly language. Large programs would never be written entirely in assembly language. It would be more efficient to use a higher-level language such as BASIC, Pascal, FORTRAN, COBOL, LISP, or C. Before a program is compiled, it can be run using an interpreter. Thus a program could be written in the BASIC language using a text editor or a word processor or the interpreter and given an extension of .BAS. This program can not run on its own even if we rename it to have a .COM or .EXE extension. There are only two ways to run it. It can be compiled and then run normally like any other program or it can be run through the interpreter. ---------------------------------------------------------------------- USING BASIC PROGRAMS Any file with an extension of .BAS is normally a BASIC program (unless it has been misnamed or just happens to have been given that extension for some other reason). A BASIC program can only be run through the BASIC interpreter. A BASIC language interpreter has been supplied with every version of DOS. With MS-DOS versions 3.3 and 4.01 this program would be named GWBASIC.EXE. With PC-DOS it might be called BASIC or BASICA. With DOS 5 and higher the QBASIC interpreter is supplied. DOS has never included a BASIC compiler. QBASIC is an abridged version of Microsoft QuickBASIC, which includes a compiler. Due to the widespread availability of BASIC, as it is supplied with DOS, you may often encounter programs written in BASIC and you may want to know how to run them. Although BASIC may be considered somewhat obsolete compared to more recent languages such as Pascal and C, it is a good place to begin learning about programming as it is easy to learn and the price is right. There are two ways to run a BASIC program using the interpreter. The first is to enter the name of the interpreter and the name of the BASIC program, separated by a space, at the command prompt. Example: C:\>GWBASIC BASPROG.BAS The second way is to first call up the interpreter, then load the program into it and then run the program. Using the first method, the program will run just like any other program and should return you to the DOS command prompt when finished. Using the second method requires some knowledge of BASIC and the BASIC interpreter. BASIC is an acronym which stands for Beginners All-purpose Symbolic Instruction Code. There are many versions of BASIC and while there are some incompatibilities, for the most part they are compatible. ---------------------------------------------------------------------- GWBASIC The complete set of commands, statements and functions which comprise the GWBASIC language can be found in one of the books that is supplied with DOS 3.3 or 4.0. Even if you are not interested in learning to program in BASIC there are a few commands you should know if you want or need to run .BAS files: NEW clears a previous program from the interpreter. LOAD loads a program into the interpreter. RUN executes a program which has been loaded. LIST shows the complete program on the screen. SAVE saves a program to disk. SYSTEM terminates the interpreter and returns you to DOS. stops a program and returns to the OK prompt. Upon typing GWBASIC to call the interpreter you will be presented with a screen which is used for writing and editing BASIC programs. The word OK should appear at the left of the screen and the cursor should appear below it. BASIC commands may be entered at the cursor. You may see some commands listed across the bottom of the screen. The numbers corresponding to these refer to function keys. These keys may be used to save keystrokes. To load a program type LOAD and then the program name separated by a space. To run a program type RUN and then the program name separated by a space. It is not necessary to type NEW if no other program has been run since calling the interpreter. It is also not necessary to save the program after running it unless it is a new program that has not yet been saved. There are some interesting things to know about the SAVE command. A program which is saved just by typing SAVE and the program name will be saved in a compressed form. A program which is saved by typing SAVE, then the program name in quotation marks and followed by ,a will be saved as a readable text file just as a program appears when listed in the interpreter. A program which is saved by typing SAVE, followed by the program name and then followed by ,p will be saved in "protected" mode - it will run normally but can not be listed. In all three cases the program is automatically given the extension .BAS. So you can see that it would be possible to obtain a program which has been saved normally, load it into the interpreter, and then save it using the ,a option in order to be able to view the program with any file viewer. Or you could just list it. If a program that is longer than one screen is listed, you will see only the last part of the program after the first part has scrolled by. You can list any part of a program, by typing LIST -100, for instance, to list it up to line 100. To exit the interpreter type SYSTEM. You can also type FILES to see a list of files with BAS extensions in the current directory. There are programs available that can unprotect a BASIC program saved with the ,p option. Examining other programs is a good way to learn how to program. If you want to learn about programming, don't try to just use the reference books supplied with DOS. These are excellent books to refer to but they offer no instruction. You can probably find a book in a library to get started with. Even a really old book (1982) may be good enough to get started with. ---------------------------------------------------------------------- QBASIC The QBASIC interpreter is supplied with DOS 5 and DOS 6. No documentation is provided, other than the built-in help. QBASIC is almost identical to Microsoft QuickBASIC, which can be purchased separately and includes a compiler. Many good books are available on QBASIC. QBASIC will not run all programs created with GWBASIC. Unlike GWBASIC, the QBASIC language does not need line numbers, though the interpreter can handle them. To run a BASIC file with QBASIC, start QBASIC by itself and use ALT-L to load a file or start QBASIC and load a program into it at the same time by typing the program-name after QBASIC, followed by a space. Then press ALT-R for "Run" and press S to select "Start program". Or you can start QBASIC with the /RUN switch to load a file and then run it. Example: C:\>QBASIC /RUN C:\DOS\GORILLA.BAS CRTL-BREAK terminates the program and returns to the QBASIC interpreter/editor screen and you can then exit with ALT-F (File) and X (eXit). MS-DOS 5.0 (but not 6.0 or 6.2) provides a few sample programs to show what QBASIC can do. These files are found in the DOS directory. GORILLA.BAS is a game. ====================================================================== BLOCK GRAPHICS CHARACTERS FROM THE ASCII CHARACTER SET The complete set of ASCII characters includes not only text characters such as upper and lower case letters, numbers, and puncuation, but also many other characters which are not assigned to a key on the keyboard. There are 256 ASCII characters which are assigned to the binary numbers 00000000 to 11111111 or the corresponding hexadecimal numbers 00 to FF or the decimal numbers 0 to 255. The normal text characters are produced by the ASCII values 32 to 127. The lower 31 values have special meanings such as line-feed and carriage return. The upper 128 characters include various miscellaneous characters and some graphics characters that can be used to draw boxes. These upper 128 characters are sometimes referred to as the IBM character set. Although we can call these graphics characters, the word graphics generally has a different meaning. Graphics mode on a PC generally means that the screen is being addressed pixel by pixel (640 x 480 pixels is regular VGA graphics) as opposed to text mode in which ASCII characters are placed in a grid of 2000 rectangles on the screen, formed by 80 colunms and 25 rows. Charts of ASCII code values can be found in many computer books including any thorough DOS book. The following chart shows only the "graphics" characters. To produce these characters: hold down the ALT key, enter the decimal ASCII value (use numeric keypad) and then release the ALT key. If you really want to do something with ASCII graphics characters get a program called THEDRAW. It will save you a lot of time and has many amazing features. It is shareware is and available from many BBSs. A little-known DOS fact: most ASCII characters over decimal value 33 are actually legal filename and directory-name characters. (Though its not a wise practice to use them in file or directory names). If your printer prints letters and numbers instead of upper-ASCII characters, try switching your printer from Epson emulation mode into IBM emulation mode. ---------------------------------------------------------------------- Block Single-Line Double-Line S Vert/D Horz D Vert/S Horz Characters Box Characters Box Characters Box Characters Box Characters 176 ° 179 ³ 185 ¹ 181 µ 182 ¶ 177 ± 180 ´ 186 º 184 ¸ 183 · 178 ² 191 ¿ 187 » 190 ¾ 189 ½ 219 Û 192 À 188 ¼ 198 Æ 199 Ç 220 Ü 193 Á 200 È 207 Ï 208 Ð 221 Ý 194 Â 201 É 209 Ñ 210 Ò 222 Þ 195 Ã 202 Ê 212 Ô 211 Ó 223 ß 196 Ä 203 Ë 213 Õ 214 Ö 254 þ 197 Å 204 Ì 216 Ø 215 × 217 Ù 205 Í 218 Ú 206 Î ====================================================================== CHANGING DOS SCREEN COLORS USING ANSI The default screen colors for DOS are white on black. Any particular program may have its own colors and many provide a means to alter these colors but you will always find your screen back to black and white as soon as you exit to DOS. The easiest way to change your DOS screen colors is to use ANSI escape codes with the prompt command. You must have ANSI loaded in order to do this. ANSI.SYS is a device driver which allows greater control over the display. ANSI.SYS is a file that you should find in your DOS directory as it is supplied with all versions of DOS. To load ANSI.SYS it must be installed as a device driver in the CONFIG.SYS file by adding the line: DEVICE=C:\DOS\ANSI.SYS Note that after editing CONFIG.SYS, you must reboot the machine in order for any changes to take effect. You should have the line PROMPT $P$G in your AUTOEXEC.BAT file. This changes your prompt from the DOS default prompt of C> to a prompt which includes the current default drive and path, such as C:\> when the root is the default directory. The prompt command can be used to alter the prompt to just about anything you might want it to be but the standard practice is to use the prompt created by placing PROMPT $P$G in AUTOEXEC.BAT. You can use the prompt command at the command prompt anytime. Typing just PROMPT at the command prompt will set the prompt back to the dos default of C>. To change the DOS screen colors you will need to use the PROMPT command with this format: PROMPT $e[_;_;_m$p$g where the blanks are to be filled in by numbers representing colors or attributes. You can use one or more numbers to specify attributes, one number for text (foreground) color, and one number for the background color. The numbers can be in any order and must be separated by semicolons. The "m" following the numbers must be lower case. Here are some examples: PROMPT $e[33;44m$p$g produces yellow on blue PROMPT $e[1;32;40m$p$g produces bold green text on black background These are the numbers that produce the colors and attributes: TEXT ATTRIBUTES TEXT COLOR BACKGROUND COLOR 1 Bold 30 Black 40 Black 4 Underscored 31 Red 41 Red (monchrome only) 32 Green 42 Green 5 Blinking 33 Yellow 43 Yellow 7 Reverse (black text 34 Blue 44 Blue on white background) 35 Magenta 45 Magenta 8 Hidden (black on black) 36 Cyan (Light Blue) 46 Cyan 0 Resets attributes to off 37 White 47 White You can experiment with different color combinations by typing in different prompt commands at the command prompt. If you find a combination you like, you can place the appropriate prompt command in your AUTOEXEC.BAT file. Use the CLS command to repaint the screen with new colors after typing in a new prompt command. If you experiment with text attributes you will need to ex