MS-DOS History The history of MS-DOS is surprisingly long.

advertisement
Seminar/Training of Group1
MS-DOS
(Microsoft Disk Operating System)
Version
Date
1.0
1981
Comments
The original version of MS-DOS. This was a renamed
version of QDOS which had been purchased by an
upstart company called Microsoft.
1.25
1982
This added support for double-sided disks. Previously
the disk had to be turned over to use the other side
2.0
1983
This added support for IBM's 10 MB hard disk,
directories and double-density 5.25" floppy disks with
capacities of 360 KB
2.11
1983
Support for foreign and extended characters was
added.
3.0
1984
Support for high-density (1.2 MB) floppy disks and 32
MB hard disks was added.
3.1
1984
Network support was added.
Version
Date
Comments
3.3
1987
This release was written to take advantage of IBM's
PS/2 computer range. It added support for high
density 3.5" floppy disks, more than one partition on
hard disks (allowing use of disks bigger than 32 MB)
and code pages.
4.0
1988
This version provided XMS support, support for
partitions on hard disks up to 2 GB and a graphical
shell. It also contained a large number of bugs and
many programs refused to run on it.
4.01
1989
The bugs in version 4.0 were fixed.
5.0
1991
This was a major upgrade. It allowed parts of DOS to
load itself in the high memory area and certain
device drivers and TSRs to run in the unused parts
of the upper memory area between 640K and 1024K.
This version also added support for IBM's new 2.88
MB floppy disks.
5.0a
1992/3
This was a minor bug fix which dealt with possibly
catastrophic problems with UNDELETE
and CHKDSK.
Version
Date
Comments
6.0
1993
This was a catch-up with Novell's DR-DOS 6. It added
a disk-compression utility called DoubleSpace, a basic
anti-virus program and a disk defragmenter. It also
finally included a MOVE command, an improved
backup program, MSBACKUP and multiple boot
configurations. Memory management was also
improved by the addition of MEMMAKER.
6.2
1993
Extra security was built into DoubleSpace following
complaints of data loss. A new disk checker,
SCANDISK, was also introduced, as well as
improvements to DISKCOPY and SmartDrive.
6.21
1993
Following legal action by Stac Electronics, Microsoft
released this version which had DoubleSpace
removed. It came with a voucher for an alternative
disk compression program.
6.22
1994
Microsoft licenced a disk-compression package called
DoubleDisk from VertiSoft Systems and renamed it
DriveSpace, which was included in this version.
Version
Date
Comments
7.0
1995
This version is part of the original version of
Windows 95. It provides support for long filenames
when Windows is running, but removes a large
number of utilities, some of which are on the
Windows 95 CD in the \other\oldmsdos directory.
7.1
1997
This version is part of OEM Service Release 2 and
later of Windows 95. The main change is support for
FAT 32 hard disks, a more efficient and robust way of
storing data on large drives.
What is DOS?
DOS stands for Disk Operating System. DOS controls the computer’s
hardware and provides an environment for programs to run. This
system program must always be present when working with your
computer.
When IBM entered the personal computer marketplace in the fall of
1981, responsibility for creating an operating system was subcontracted
to a brand new company named Microsoft. The result, MS-DOS was a
command-driven operating system that allowed users to issue cryptic,
single-line commands through a command interface. MS-DOS quickly
became an industry standard and established the financial base on
which Bill Gates and Paul Allen built today’s Microsoft. Given the
availability of Windows and other easier to use interfaces, MS-DOS is
rarely used today, however.
Why then bother to learn MS-DOS commands? Basically there are two
reasons:
1. Windows and other, more sophisticated operating systems
sometimes do a bit too much for the user, effectively hiding what is
really happening in windows.
2. Should your computer fail or become infected with a virus, many
utility and virus protection programs include a special recovery
diskette. Often, the recovery diskette is designed to boot to MSDOS and uses MS-DOS commands to support the recovery process.
3. The default drive and the system prompt are displayed by the operating
system. The user responds by typing a command name followed by necessary
parameters. A delimiter, usually a space, separates the command from the
parameters and (if there are several) the parameters from each other.
Why You Need DOS
There are a variety of reasons why you need DOS. A few of them are listed below
to satisfy your curiosity.
1. DOS controls the flow of information between you and the computer
(translator).
2. DOS allows you to store information on your computer.
3. DOS allows you to retrieve information stored on your computer.
4. DOS interprets and translates the software you have on your computer.
5. DOS gives you access to all its function (i.e. saving, copying, and printing
files).
Installing MS-DOS
When installing MS-DOS, make sure that in the BIOS the the boot disk is
set to A: first, then the hard drive (boot sequence: A:, C:) Then insert disk 1
in the A: drive, power up the computer, then follow the on-screen
instructions.
You must enter the following information:
* time and date
* country
* the media on which to install the operating system (make sure the drive
is accessible and has sufficient free disk space)
* the storage folder for MS-DOS files
* if the MS-DOS shell should appear on each start-up
* if MS-DOS should occupy a single partition taking up the entire hard
drive
The Chapter Tutorial
The introduction to MS-DOS is presented as a tutorial. Do not simply read it.
Instead, find a personal computer that runs Windows. MS-DOS error
messages tend to be rather cryptic and not very useful. Common mistakes
include misspelling a command or file name, failing to type a space between
a command and its parameters or between parameters, and adding extra,
unnecessary parameters. If you type a command, press enter, and see an error
message, simply retype the command after the next MS-DOS prompt.
The easiest and safest way to access MS-DOS through Microsoft Windows is
to select the MS-DOS Prompt from the programs menu. Click on the Start
button. Then move the mouse pointer to Programs. You should find an entry
labeled MS-DOS Prompt check the Accessories submenu under Windows
2000. Click on MS-DOS Prompt and the initial MS-DOS screen (or window)
will appear You can boot the system from an MS-DOS system diskette. If you
shut down Windows, the third option on the shut down menu is Restart the
computer in MS-DOS mode. Stay with the MS-DOS Prompt for now,
however.
MS-DOS Seminar/Training
This tutorial gives you an opportunity to try basic MS-DOS commands. By
following the procedures in this section, you will learn to:
•View the contents of a directory
•Change from one directory to another
•Create and delete directories
•Change from one drive to another
•Copy files
•Rename files
•Delete files
•Format a floppy disk
Common
MS-DOS Commands
ATTRIB
displays or changes file attributes
CHDIR or CD
displays the name of the current directory or changes the
current directory --- cd < directory name>
CHKDSK
checks the status of a disk and displays a status report; it can
also fix disk errors
CLS
clears the screen
COPY
copies one or more files to a destination you specify
--- copy <source> <destination>
DEL or ERASE
deletes the files you specify
DELTREIE
deletes a directory and all the files and subdirectories that are
in it --- del<file>
DIR
displays the files and subdirectories that are in the directory
you specify --- dir [ name of directory]
DISKCOPY
copies the entire contents of one floppy disk to another
floppy disk. It writes over the existing contents of the
destination disk as it copies the new information on it.
ECHO
displays or hides the text in batch programs when the
program is running.
EDIT
starts MS-DOS Editor, a text editor you can use to create and
edit ASCII text files. --- edit <filename>
EXIT
quits the MS-DOS command interpreter and returns to the
program that started it, if one exists.
FASTHELP
displays a list of all MS-DOS 6 commands and gives a short
explanation of each.
FIND
searches for a specific string of text in a file or files
FORMAT
formats a disk for use with MS-DOS
HELP
starts MS-DOS Help
MKDIR or MD
creates a directory
MEM
displays the amount of used and free memory on your
computer
MORE
displays one screen of output at a time
MOVE
moves one or more files to the location you specify
--- move <source> <destination>
MSBACKUP
backs up or restores one or more files from one disk onto
another
MSD
Provides technical information about your computer
PRINT
prints a text file while you are using other MS-DOS commands
QBASIC
starts MS-DOS Qbasic
RD or RMDIR
deletes a directory
REN
changes the name of the file or files you specify
--- ren <source> <destination>
SCANDISK
starts a disk analysis and repair tool that checks a drive for
errors and corrects any problems that it finds.
TREIE
graphically displays the structure of a directory
UNDELETE
restores files that were deleted previously by using the DEL
command
VER
displays the MS-DOS version number
XCOPY
copies directories , their subdirectories, and files except
hidden and system files.
Below is a listing of each of the MS-DOS commands currently listed on
Computer Hope and a brief explanation of what each of the commands do.
Aansi.sysNSI.SYS
Defines functions that change display graphics, control cursor movement, and
reassign keys.
append
Causes MS-DOS to look in other directories when editing a file or running a
command.
arp
Displays, adds, and removes arp information from network devices.
assign
Assign a drive letter to an alternate letter.
assoc
View the file associations.
at
Schedule a time to execute commands or programs.
atmadm
Lists connections and addresses seen by Windows ATM call manager.
attrib
Display and change file attributes.
batch
Recovery console command that executes a series of commands in a file.
bootcfg
Recovery console command that allows a user to view, modify, and rebuild the
boot.ini
break
Enable / disable CTRL + C feature.
cacls
View and modify file ACL’s.
call
Calls a batch file from another batch file.
cd
Changes directories.
chcp
Supplement the International keyboard and character set information.
chdir
Changes directories.
chdsk
Check the hard disk drive running FAT for errors.
chkntfs
Check the hard disk drive running NTFS for errors.
choice
Specify a listing of multiple options within a batch file.
cls
Clears the screen.
cmd
Opens the command interpreter.
color
Easily change the foreground and background color of the MS-DOS window.
command
Opens the command interpreter.
comp
Compares files.
compact
Compresses and uncompress files.
control
Open Control Panel icons from the MS-DOS prompt.
convert
Convert FAT to NTFS.
copy
Copy one or more files to an alternate location.
ctty
Change the computers input/output devices.
date
View or change the systems date.
debug
Debug utility to create assembly programs to modify hardware settings.
defrag
Re-arrange the hard disk drive to help with loading programs.
del
Deletes one or more files.
delete
Recovery console command that deletes a file.
deltree
Deletes one or more files and/or directories.
dir
List the contents of one or more directory.
disable
Recovery console command that disables Windows system services or drivers.
diskcomp
Compare a disk with another disk.
diskcopy
Copy the contents of one disk and place them on another disk.
doskey
Command to view and execute commands that have been run in the past.
dosshell
A GUI to help with early MS-DOS users.
drivparm
Enables overwrite of original device drivers.
echo
Displays messages and enables and disables echo.
edit
View and edit files.
edlin
View and edit files.
emm386
Load extended Memory Manager.
ename
Recovery console command to enable a disable service or driver.
fendlocal
Stops the localization of the environment changes enabled by the set local
command.
erase
Erase files from computer.
exit
Exit from the command interpreter.
expand
Expand a Microsoft Windows file back to it's original format.
extract
Extract files from the Microsoft Windows cabinets.
fasthelp
Displays a listing of MS-DOS commands and information about them.
fc
Compare files.
fdisk
Utility used to create partitions on the hard disk drive.
find
Search for text within a file.
findstr
Searches for a string of text within a file.
fixboot
Writes a new boot sector.
fixmbr
Writes a new boot record to a disk drive.
for
Boolean used in batch files.
format
Command to erase and prepare a disk drive.
ftp
Command to connect and operate on a FTP erver.
ftype
Displays or modifies file types used in file extension associations.
goto
Moves a batch file to a specific label or location.
graftabl
Show extended characters in graphics mode.
help
Display a listing of commands and brief explanation.
if
Allows for batch files to perform conditional processing.
ifshlp.sys
32-bit file manager.
ipconfig
Network command to view network adapter settings and assigned values.
keyb
Change layout of keyboard.
label
Change the label of a disk drive.
lh
Load a device driver in to high memory.
listsvc
Recovery console command that displays the services and drivers.
loadfix
Load a program above the first 64k.
loadhigh
Load a device driver in to high memory.
lock
Lock the hard disk drive.
logoff
Logoff the currently profile using the computer.
logon
Recovery console command to list installations and enable administrator login.
map
Displays the device name of a drive.
md
Command to create a new directory.
mem
Display memory on system.
mkdir
Command to create a new directory.
mode
Modify the port or display settings.
more
Display one page at a time.
move
Move one or more files from one directory to another directory.
msav
Early Microsoft Virus scanner.
msd
Diagnostics utility.
msdex
Utility used to load and provide access to the CD-ROM.
nbtstat
Displays protocol statistics and current TCP/IP connections using NBT
net
Update, fix, or view the network or network settings
netsh
Configure dynamic and static network information from MS-DOS.
netstat
Display the TCP/IP network protocol statistics and information.
nlsfunc
Load country specific information.
nslookup
Look up an IP address of a domain or host on a network.
path
View and modify the computers path location.
pathping
View and locate locations of network latency.
pause
Command used in batch files to stop the processing of a command.
ping
Test / send information to another network computer or network device.
popd
Changes to the directory or network path stored by the pushd command.
power
Conserve power with computer portables.
print
Prints data to a printer port.
prompt
View and change the MS-DOS prompt.
pushd
Stores a directory or network path in memory so it can be returned to at any time.
qbasic
Open the QBasic.
rd
Removes an empty directory.
ren
Renames a file or directory.
rename
Renames a file or directory.
rmdir
Removes an empty directory.
route
View and configure windows network route tables.
runas
Enables a user to execute a program on another computer.
scandisk
Run the scandisk utility.
scanreg
Scan registry and recover registry from errors.
set
Change one variable or string to another.
setlocal
Enables local environments to be changed without affecting anything else.
setver
Change MS-DOS version to trick older MS-DOS programs.
share
Installs support for file sharing and locking capabilities.
shift
Changes the position of replaceable parameters in a batch program.
shutdown
Shutdown the computer from the MS-DOS prompt.
smartdrv
Create a disk cache in conventional memory or extended memory.
sort
Sorts the input and displays the output to the screen.
start
Start a separate window in Windows from the MS-DOS prompt.
subst
Substitute a folder on your computer for another drive letter.
switches
Remove add functions from MS-DOS.
sys
Transfer system files to disk drive.
telnet
Telnet to another computer / device from the prompt.
Time
View or modify the system time.
title
Change the title of their MS-DOS window.
Tracert
Visually view a network packets route across a network.
tree
View a visual tree of the hard disk drive.
type
Display the contents of a file.
undelete
Undelete a file that has been deleted.
unformat
Unformat a hard disk drive.
unlock
Unlock a disk drive.
ver
Display the version information.
verify
Enables or disables the feature to determine if files have been written properly.
vol
Displays the volume information about the designated drive.
xcopy
Copy multiple files, directories, and/or drives from one location to another.
Selecting the Default Drive
The last line on the screen holds the MS-DOS prompt:
C:\WINDOWS>
The letter C is the current default drive (on most systems, C indicates the hard
drive). To the right, the greater than (>) symbol indicates that MS-DOS is waiting
for you to enter a command. WINDOWS is the name of the current directory.
Insert a blank diskette into a diskette drive. Then type the letter A
followed by a colon; the prompt line should read
C:\WINDOWS>A:
Although the sample commands will be typed upper case, you can type
MS-DOS commands in either upper case or lower case. A new prompt will
appear
A:\>
Drive A is now the default. Make sure the prompt reads A:\> before you
move on the next step.
Formatting Diskette
The formatting process writes a pattern of sectors on the disk surface,
records a copy of the boot routine on the first sector, initializes second
information.
The FORMAT command is used to format a disk. The simplest form
consists of a single word: FORMAT.
Be careful, however, because format is a destructive command. When you
format a disk, you lose whatever data might be stored on it.
Caution: If your default drive is a hard drive (for example, drive C), do not,
under circumstances, format that disk. You could destroy your system.
Before you move on to the next step in this tutorial, make sure your
default drive is your diskette drive (usually, drive A). If not, type A: and
press the enter key. Even with the default drive set correctly, it is a good
idea to specify the target drive as part of your command. For example, type
the command
FORMAT A:
The File System
The MS-DOS file system allows a users to identify, save, and retrieve files by
name. Note that a program is a type of file.
File Names
A file name is composed of the name itself and an optional extension. The
name consists of from 1 to 8 characters. A few file names are reserved by the
system, and delimiters may not be used. Otherwise, just about any
combination of characters you can type is legal. The file name is separated
from its optional, 1 to 3 character extension by a period. Some extensions have
a special meaning to the operating system. The extension is sometimes used
to identify a version of a program or data file. For example: VITA.1, VITA.2 and
so on.
Directories
Directory management is a key function of the MS-DOS file system. The first
time a file is written to disk, its name, disk address, creation date, and other
information are recorded in the directory. Later, when the file is retrieved, the
operating system reads the directory and searches it by name. When a file is
modified, the file system updates its directory entry. When the file is deleted,
its directory entry is deleted.
Subdirectories
When a disk is first formatted, a single root directory is created by the format
routine. Using a single directory is fine for a few files, but as the number of files
increases, distinguishing them becomes increasingly difficult.
For example, imagine a work disk that holds several different types of files. To
simplify keeping track of the files, MS-DOS allows the user to create special files
called subdirectories.
Path Names
When subdirectories are used, you need more than a simple file name to find a file.
For example, it is possible to have files named PAY stored on two different
subdirectories. A reference to PAY would does be ambiguous –which PAY do you
mean?
To fully identify a file you need a complete path name. For example:
\LETTERS\PAY
and
\WS\PAY
are two different files.
Batch Files
A Batch file is a file of precoded MS-DOS commands. You can assign any file name
to a batch file, but the extension must be .BAT. If you type the batch file’s name and
press enter. MS-DOS will execute the commands in sequence. For example, a file
named AUTOEXEC.BAT is automatically executed each time the system is booted(if
such a file exists).
Program Files
A program is a special type of file. By convention, executable programs are assigned
the extension .COM or .EXE. To load and execute a program, simply type its file
name (with or without its extension) as though it was a command. If no extension is
given, MS-DOS will look for a command with the specified file name and a .COM
extension, then search for a .EXE file, and finally for a .BAT file.
Pipes, Filters, and Redirection
Many MS-DOS commands assume a standard input or output device; for example,
the directory command sends its output to the screen. By using redirection
parameters the user can change those defaults. For example, the command
DIR>PRN
sends the output directory listing to the printer.
A filter is a special type of command. It accepts input from the standard
input device, modifies (or filters) the data in some way, and sends the results to the
standard output device. For example, the SORT filter accepts data from the
keyboard, sorts the data into alphabetical or numerical sequence, and outputs the
sorted data to the screen. You can add redirection parameters to override or change
the standard input device, output device, or both.
Try an example. Make sure your diskette is in the drive and type the
command
SORT <A:\LETTERS\JIM
Because of the redirection parameter (<), this SORT filter accepts its input from
the file named JIM. The output, the lines of text that you typed when you created
JIM sorted into alphabetical order, should appear on your screen. For future
reference, to sort and store the output on a different file, code something like
SORT<MYFILE>RESULT
Note that both source and destination redirection parameters are included.
The MORE command is another useful filter. It sends output to the
terminal one screen at a time. MORE is often used with pipes. A pipe causes one
command’s standard output to be used as the standard input to another
command. Pipes are designed by a vertical line (|); you will find this character
near the top right of most alphanumeric keyboards.
For example, type
C:
And press enter to make drive C your default drive and WINDOWS your current
directory. Then type
DIR
Press enter, and watch the file names scroll by too quickly to read. Now type the
command
DIR | MORE
The directory command’s standard output will be routed to the MORE filter
rather than directly to the screen. The filter will display one screen and then wait
until you press the enter key before it displays the next one.
Try another experiment. Sort the WINDOWS directory and then display
it one screen at a time. It’s easy. Just code
DIR|SORT|MORE
And press enter. Not that the file names are displayed one screen at a time in
alphabetical order.
Returning to Windows
That completes the chapter tutorial. To return to Windows, type the command
EXIT
And press the enter key.
MS-DOS is a powerful operating system and you have barely scratched
the surface of its command language. However, given a clear understanding of
the commands in this brief tutorial, you should be able to read a reference
manual and determine how to use additional commands on your own.
Evaluating an Operating System
If an operating system is to be a hardware/software interface, it makes sense to
design an efficient interface. Thus, on most modern computers, the operating
system serves as the primary resource manager, responsible for managing
processor time, memory space, registers, input and output devices, secondary
storage space, and data and program libraries. A well-designed operating system
attempts to optimize the utilization of all the system resources.
Measures of Effectiveness
A number of criteria are used to measure a computer systems performance,
including:
Throughput. Generally, total execution time (for all programs) divided by total
elapsed time.
Turnaround. The elapsed time between job submission and job completion.
Response time. The elapsed time between a request for the computer’s attention
and the computer’s response.
Availability.
Security.
Reliability.
Cause.
Ease of use.
MS-DOS Internals
MS-DOS was once the world’s most commonly used microcomputer operating
system. Although it has been largely supplanted by Microsoft Windows, it still
runs under Windows.
The Shell
MS-DOS is command driven. Users request support by typing commands in
response to a system prompt. When the return key is pressed, the shell, called
COMMAND.COM, interprets the command and calls the appropriate lower
level routine or program. COMMAND.COM consists of a program interpreter
and a number of resident operating system routines that remain in memory at
all times. Other routines are transient and are read into memory on demand.
Generally, those routines needed to support an active program are resident.
Accessing Peripherals
The task of accessing peripheral devices is divided between two operating
system modules. IO.SYS is a hardware dependent module that is used
physical data transfer commands. This module interacts with the basic
input/output system (BIOS) usually implemented in read-only memory.
Logical I/O is implemented by a hardware independent module called
MSDOS.SYS. MSDOS.SYS accepts logical input/output from application
programs or other operating system modules, translates them into
physical I/O commands, and passes the physical commands to IO.SYS.
Each physical device attached to the computer is described in a special file
called a device driver. Character drivers control such devices as the
keyboard, the screen and the printer.
Interrupt Processing
The interrupt itself consists of an electronic pulse and the address of an
interrupt vector. When an interrupt occurs, hardware immediately copies
the contents of the IP register to the stack, and loads the specified interrupt
vector into the IP register. Once, the interrupt is processed the contents of
the stack are copied back into the IP register, and the original program
resumes processing.
Interrupts are much more common than you might imagine. For example,
each time you press a key on the keyboard, an interrupt is generated. In
response, the operating system copies a single character into memory and
then waits for the next interrupt to herald the arrival of the next character.
Hardware response to a software-generated interrupt exactly as if the source
had been hardware, copying the IP register to the stack and loading the
contents of the specified vector into IP register.
Booting MS-DOS
Memory is volatile; it loses its contents when the computer loses
power. Consequently, the operating system must be read into
memory each time the computer is switched on. Under MS-DOS, the
boot routine is stored on the first sector of each disk. Flipping the
power switch (or simultaneously pressing CTRL, ALT, and DELETE)
causes hardware to read into memory the first sector from the disk
in the system drive.
The COMMAND.COM modules that immediately follow
MSDOS.SYS are resident. Other COMMAND.COM modules are
stored at the high end of memory following the transient area.
Running MS-DOS
Once loaded, MS-DOS controls literally everything that happens on
the computer. First, COMMAND.COM gets control and, by calling
IO.SYS, displays a system prompt on the screen. As the user types a
command, each character generates an interrupt. Responding to the
interrupt, the operating system reads the character, stores it in
memory, and again using IO.SYS, display it. The basic work flow is
simple. A prompt is displayed. The user types a command or
program name. The appropriate operating system module or
application program gets control. As the program runs, the
operating system provides support by processing interrupts.
Eventually, the module returns control to COMMAND.COM and the
process is repeated, again and again, until the machine is shut down.
MS-DOS is command driven.
The File System
The MS-DOS file system allows users to identify, save, and retrieve files by name.
Note that a program is a type of file.
MSDOS.SYS converts logical I/O requests to physical form. One of its responsibilities
is directory management.
MSDOS.SYS also supports application programs. When a disk file is first opened,
MSDOS.SYS asks IO.SYS to read the directory. It then extracts the location of an
existing file or creates a directory entry for a one and, if necessary, asks IO.SYS.
MSDOS.SYS responsibility is allocating space on disk. Quickly overview a disk
format.
Disk space allocated in clusters. Each cluster holds 1,024 bytes. The clusters are
numbered sequentially with zero and the file allocation table contains an entry for
each cluster on the disk.
MS-DOS views the data’s word in a disk file as a continuous stream of bytes. Logical
I/O operations request data by relative byte. MS-DOS.SYS calls IO.SYS to perform
whatever physical input/output operations are necessary to access the requested
string. Logically, data on disks are addressed just like data in memory.
Set the Date and Time
Most computers on campus have an internal clock that will automatically set the
date and time for you when you turn the computer on. However, if your
computer does not have this feature or your computer has two floppy drives, you
will need to do the following steps to set the date and time.
Directions:
1. Type the date like this: 1-15-97
2. Press the return key (enter key).
3. Type the time like this: 8:46
4. Press return.
5. Notice that the C:\> prompt will appear.
DOS marks the date and time on everything you do. It is important to
periodically check the date and time if you have an internal clock to see if it is
correct. If you have a two floppy system, it is important to enter the correct date
and time when you turn the computer on.
Check the Date and Time
DOS will let you check or change the date and time once it has been set. The procedure
to do this is as follows:
Directions:
1. Type: date and press return.
2. If the correct date is displayed, simply press return. If the date is incorrect, type the
correct date and press return.
3. Type: time and press return.
4. If the correct time is displayed, simply press return. If the time is incorrect, type the
correct time and press return.
Directory Command
The DIRECTORY command is like a table of contents in a book. This directory will list
the following information:
· Filenames
· File extensions
· Size of each file
· Date and time the file was last updated.
Directions:
1. At the C:\> type: dir and press return.
2. The list of files will scroll up and off the screen.
NOTE: At the end of the listing, there is a line that shows the number of bytes free on
the hard drive.
At first glance, subdirectories may seem to complicate rather than simplify the task
of accessing files. In practice, however, people rarely use such lengthy path names.
Instead, they select a working directory and allow the operating system to keep track
of the subdirectories needed to complete a path name.
Create a File with DOS
Directions:
1. Type: copy con Eimz.txt and press return.
2. Type this message in the following format:
Eiman
is
beautiful
joke.
3. Press the F6 function key (^Z) and press return.
4. DOS gives you a message that 1 File(s) has been copied.
5. Type: dir e* and press return.
6. Now you can see the list of files beginning with the letter E.
Manipulating Files
Copy a File
You can use the COPY command to copy one file to another.
Directions:
1. Type: copy eimz.txt esheen.txt and press return.
2. DOS will tell you one file has been copied.
3. Type: dir e* and press return.
4. You should have two files listed with different names.
NOTE: Filenames cannot be more than eight characters in length. File extensions
cannot be more than three characters in length.
Copy a File with a New Extension
You can also use the COPY command to copy the file with a different filename
extension.
Directions:
1. Type: copy eimz.txt eimz.jpgand press return.
2. Type: dir e* and press return.
3. Three files should be listed.
Rename a File
The RENAME command lets you rename a previous file with a new name.
Directions:
1. Type: ren eimz.txt esheen.txt and press return.
2. Type: dir *.txtand press return.
Scroll Through the Directory Listing
When you type the DIR command and press return, the files begin to scroll
vertically on your screen. If you have a lot of files it is difficult to read each one. By
holding down the Control Key (CTRL) and the letter S at the same time, you are
able to freeze the listing to view your files. When you are finished, press the
spacebar for the list to continue.
NOTE: You must return to the C:\> before entering your next command.
Pause a Directory Listing
You can add a PAUSE command to your directory command which will allow you
to view your directory one screen at a time.
Directions:
1. Type: dir/p and press return.
2. The screen freezes after it fills the screen with the files that are listed first in the
directory.
3. Press the spacebar to continue listing you files.
4. Continue to press the spacebar until you return back to the C:\> prompt.
View a Wide Listing of Files
When you need to quickly view your files, you can add a /W to the directory
command. This will display your files into five columns on the screen.
Directions:
1. Type: dir/w and press return.
2. DOS will list only the name of you file and the file extension on the screen.
NOTE: Use this command when you are not concerned with looking at the file size
or the date it was created.
Recall a DOS Command
The F3 function key can be used to recall the last DOS command you typed in. If
you would like to retrieve a previously entered command, you can also press the up
arrow key continuously until you reach the desired command you were looking for.
NOTE: You can also type out each letter in your last command by using the right
arrow key or the right cursor key. After you use the F3 key to recall a command,
you can use the backspace key to edit any part of the command or add to your
command.
Check for a Single File
Instead of using the directory command to look for one particular file, you can
type the name of the file after the DIR command at the C:\> prompt.
Directions:
1. Make sure that you are at your C:\> prompt.
2. Type: dir format.com (filename.extension) and press return.
3. The screen will display a listing of the file or a file not found message.
Check for a Group of Files
The * symbol is referred to as a wildcard and stands for any character or group of
characters.
This is helpful when you want to list files that start with a particular letter or
group.
Directions:
1. Type: dir c* and press return.
2. All filenames that begin with the letter C will be listed.
3. Press the F3 key.
4. Backspace twice and replace C* with A* and press return.
5. All filenames that begin with the letter A are listed.
List Files with the Same Extensions
You can also use the wildcard character * to look for a group of files with the
same extension.
Directions:
1. Type: dir *.bat and press return.
2. All files with the .bat extension are listed.
3. Press the F3 key.
4. Backspace three times and replace the .bat extension with the .sys
extension and press return.
5. All files with the .sys extension should now be listed.
Clear the Screen
When the screen get full of information, you may want to clear it. To do this,
type CLS at the C:\> prompt and press return.
Rename a Group of Files
With the wildcard character *, you can also use the RENAME command to
change a group of files.
Directions:
1. Type: ren *.txt *.bob and press return.
2. Type: dir *.bob and press return.
3. You should have two files listed with a .bob extension.
4. Type: dir *.txt and press return.
5. There should be no files found with .txtextensions.
Create a Subdirectory
To create a subdirectory, you will need to use the MAKE DIRECTORY
command, a.k.a.
MD. The MD command is useful for organizing files on your hard drive. With
subdirectories, you can create and store related files together. For example, one
subdirectory could be used to store all word processing files and another for all
spreadsheet files.
Directions:
1. Type: md \info and press return.
2. Type: dir *. and press return.
3. Notice the *. will list only the subdirectories.
Move to a Subdirectory
Once you have created a subdirectory, to move to that directory, you will use
the CHANGE DIRECTORY command, a.k.a. CD.
Directions:
1. Type: cd \info and press return.
2. Type: cd and press return.
3. The name of the directory is listed.
Move to the Parent Directory
DOS has a quick way to move from the current directory back to the parent
directory.
Directions:
1. Type: cd.. and press return.
2. You will return back to the C:\> prompt.
Copy a File into a Subdirectory
The COPY command lets you copy files from one directory to another.
Directions:
1. Type: copy esheen.bob \info and press return.
2. Type: dir \info and press return.
3. Notice that a copy of Sales.bob is copied into the subdirectory Info. The
original file is also in the root directory.
Copy a Group of Files into a Subdirectory
When copying a group of files from the root directory into a subdirectory, it is
necessary to use the wildcard character * along with the COPY command.
Directions:
1. Type: copy dawn.* \info and press return.
2. DOS will list the files being copied.
3. Type: dir \info and press return.
4. Three files should be listed in the Info subdirectory.
List Files in a Subdirectory
The CHANGE DIRECTORY, a.k.a. CD, command will let you list files in your
subdirectory from your hard drive.
Directions:
1. Type: cd \info and press return.
2. Type: dir and press return.
3. All files in the Info subdirectory are listed.
List Files in the Root from a Subdirectory
The DIRECTORY command is also used to get a listing of all the files in the root
directory while in a subdirectory. The backslash character \ represents the root
directory.
Directions:
1. Type: dir \ and press return.
2. All the files in the root directory are listed.
Select the Directory List
To look for a specific filename extension, you can use the SELECTED
DIRECTORY command.
Directions:
1. Type: dir \*.bat and press return.
2. Only the files with the .bat extensions are listed.
3. Press the F3 key.
4. Backspace three times.
5. Type: sys and press return.
6. Now only the files with the .sys extensions are listed.
List Subdirectories
Directions:
1. Type: dir \*. and press return.
2. All the subdirectories are listed.
NOTE: The backslash character \ directs DOS to read from the root directory.
The *. requests the listing of the subdirectories.
Delete a Single File
Periodically it is a good idea to delete files from the hard disk which are no longer
needed or used. DOS makes it easy to remove these files with the DELETE
command, a.k.a. DEL.
Directions:
1. Type: cd.. and press return.
2. The prompt shows you that you are back in the root directory.
3. Type: del eimz.bob and press return.
4. Type: dir eimz.bob and press return.
5. Sales.bob is no longer listed because it has been deleted.
Delete a Group of Files
By using the wildcard character * you can delete a group of files from your hard drive.
Directions:
1. Type: del eimz.* and press return.
2. Type: dir eimz.* and press return.
3. All Quick files have been deleted.
Delete all Files in a Subdirectory
There are two rules you will need to follow before removing a subdirectory.
RULE 1: All files in the subdirectory must be deleted.
NOTE: Never type DEL *.* when you are in the root directory. It will destroy all
DOS files that are necessary to boot and operate the computer.
Directions:
1. Type: cd \info and press return.
2. Type: dir and press return.
4. Type: del *.* and press return.
5. DOS will ask you if you are sure? (Y/N)
6. Type: Y and press enter.
Now your subdirectory is empty.
Remove a Subdirectory
RULE 2: You cannot be in the subdirectory that you wish to remove. You will
need to return
to the root directory (C:\> prompt).
Directions:
1. Type: cd.. and press return.
2. You should be back in the root directory.
3. Type: rd \info and press return.
4. Type: dir *. and press return.
5. Notice that the Info subdirectory is no longer listed.
Format a Floppy Disk
Before you can use a disk, you must format it.
Directions:
1. At the C:\> prompt type: format a:
2. The A drive will be the drive that you insert your disk into; hence, the a: after
the Format command and press return.
3. You will be prompted with the message: "Insert new diskette for drive A: and
press enter
when ready."
4. Now insert the disk you wish to format and press return.
5. Once this formatting process is done, the following message will appear:
"Format
Completed." Then you will be prompted for a volume label. Simply press return
again.
6. Now you will be asked if you would like to format another disk (Y/N)? Press
N.
NOTE: If you receive a message like: "Track 0 bad" or "Disk unusable," your disk
may be the wrong capacity. You can get help with this error message by typing:
Help Format.
Change the Default Drive
To change from your hard drive to a floppy drive, you will need to indicate
this change as follows:
Directions:
1. Put a floppy disk into drive A.
2. Type: a: and press return.
3. Your prompt should change to A:\>
4. Type: dir and press return.
5. You are now able to see all the files on the floppy.
6. To change back to your hard drive, you will need to reverse this
procedure.
7. Type: c: and press return. Now your prompt should be C:\>
Diskcopy Command
Sometimes there is a need to copy all the files on one floppy diskette to
another floppy. First you will need a blank formatted disk (refer to section on
formatting disks.)
Directions:
1. Type: diskcopy a: a: and press return.
2. When asked to put in the source disk, put in the diskette that has the
information you want to copy into drive A and press return.
3. Wait a few seconds. When asked to insert a target disk, take out the
diskette from drive A and insert the blank floppy disk and press return.
4. Once this process is complete, you will be prompted to write to another
duplicate diskette (Y/N). Press N.
5. Then you will be prompted to copy another disk (Y/N)? Press N.
NOTE: If your machine has two floppy disk drives, insert the original
(source) disk into drive A and the blank (target) disk into drive B. Then type:
DISKCOPY A: B:
Copying a File from the Hard Drive to a Floppy Disk
Sometimes there is a need to copy a file from the hard drive onto a floppy disk.
This is helpful if you would like to have an extra copy of a certain file as a backup
or to transport the copied file to another computer.
Directions:
1. Type: copy <insert filename here> a: and press return.
2. Wait for a few seconds, notice the red light on the floppy drive. Never attempt
to remove a disk from the disk drive while this red light is on.
3. To check to see if the file was copied, type a: at the C:\> prompt and press
return.
4. Type: dir and press return.
Using The ATTRIB Command
The ATTRIB command is used to set file attributes like making a file read-only or
make it a hidden file. All the different file attributes is listed below:
R
Read-only file attribute.
A Archive file attribute.
S System file attribute.
H
Hidden file attribute.
If you are still in the MS-DOS Editor click on "File" and then on "Exit". If you
followed along the Command Prompt should currently be "C:\MainDir\SubDir2>".
If it is not the case use the CD or CD.. command to change it to
"C:\MainDir\SubDir2>". Type Dir at the Command Prompt and make sure that the
files "File2.txt" and "File2.dat" are present in this subdirectory. If it is not the case
exactly repeat the steps explained in the "Editing Text Files" section. At the
Command Prompt type Attrib +r File2.txt and press the "Enter" key. File2.txt
should now be a read-only file. You can test this by typing Dir at the Command
Prompt. Both "File2.txt" and "File3.dat" should now be listed. Now type Dir /ar at
the Command Prompt and press "Enter". With this command entered like this
only read-only files will be listed and you should now only see "File2.txt" listed.
MS-DOS & Windows
command line errors
A duplicate file name exists, or the file cannot be found
When attempting to rename a file, the file does not exist or there is already a file
with that name. Verify no other file exists with the same name in the current
directory and/or that you're typing the file you wish to rename correctly.
Abort, Retry, Fail?
This error is commonly encountered when attempting to read a diskette that is
not readable or if no disk or disc in the drive trying to be read.
Access denied
Often caused when the file or directory has read-only attributes, is being
modified by another person or program on the computer, and/or other network
permissions that prevent it from being deleted or modified.
Bad command or file name
Commonly caused by a misspelling or error when typing a command and/or
when the command attempting to be used is not a valid command for your
version of MS-DOS or Windows.
Bad or missing command interpreter
The computer cannot locate the command.com, an important file that that enables
the computer to boot into the operating system.
This error occurs when you're trying to copy or xcopy all directories and files and
that directory also contains the directory you're copying all the files to. If this
command were to be allowed it would get into a loop and would never stop
copying the same files over and over. When using the xcopy command if you're
copying all subdirectories you must copy those files and folders to a completely
separate directory or drive.
Divide overflow
Program has attempted to divide something by zero. This error is often caused by
an error in the program you're running on your computer. Verify there are no
available patches or other updates for the software you're using on your computer.
Duplicate file name or file not found
When attempting to rename a file, the file does not exist or there is already a file
with that name. Verify no other file exists with the same name in the current
directory and/or that you're typing the file you wish to rename correctly.
File cannot be copied onto itself
An attempt to copy a file could not be completed because the file already exists or
same source and destination. Copy the file to an alternate drive or directory.
File creation error
Directory could be full because of the DOS limitation of files in one directory, the
file already exist, and/or the file was not copied correctly. Try creating or copying
the file in a different directory.
File not found
The file you attempted to list, copy, or edit does not exist in the directory you're in.
Verify you're in the correct directory and that the file exists in that directory.
This error may also occur if you're using a back slash instead of a forward slash for
switches on commands. For example, doing dir \p instead of the proper dir /p.
General Failure
An unknown error has occurred that is not known by MS-DOS. If this is given
when trying to read the hard drive, you may need to format the hard drive as it
could be failing or already bad.
Insufficient disk space
Disk is full or, if you are trying to copy am file to a disk, the file is too big to fit on
the disk.
Internal stack overflow
The MS-DOS internal storage areas are full. You may need to go into your
config.sys and increase the STACKS=0,0
Invalid directory
The directory or path you attempted to enter does not exist in the directory or
drive you're currently in.
Invalid drive specification
The drive letter you're typing does not exist on the computer.
Invalid file name or file not found
This error occurs when attempting to rename, copy, or otherwise manipulate a
file the file does not exist. Verify you're typing the file you wish to rename
correctly.
Invalid media, track 0 bad or unusable
Format command cannot format the specified disk or the disk capacity is
invalid, or bad disk.
Invalid number of parameters
When the command was typed, something was left out that DOS needed by the
command, it was mistyped, or a space was placed where one was not needed.
This error commonly occurs when you're typing a directory in the MS-DOS or
the Windows command line that has spaces in it. For example using the xcopy
command to copy files in the Documents and Settings folder. When typing a
directory with spaces in MS-DOS make sure to surround the path with quotes.
For example, instead of typing c:\documents and settings type "c:\documents
and settings".
Invalid parameter
Typed a command correctly but specified the incorrect parameter, such as format
/z.
Invalid Switch
The wrong slash was typed, for example: cd/ instead of cd\.
Not ready, reading drive X
The drive letter you're typing does not exist on the computer or there is no disk or
disc in the drive.
Parse error
This error occurs when the command you're typing in has invalid syntax. For
example, if you're surrounding your path in quotes and leave out the ending
quotes.
The system cannot find the drive specified.
The drive letter you're typing does not exist on the computer.
The system cannot find the file specified.
This error occurs when attempting to rename, copy, or otherwise manipulate a file
the file does not exist. Verify you're typing the file you wish to rename correctly.
The system cannot find the path specified.
The directory or path you attempted to enter does not exist in the directory or
drive you're currently in.
Write fault error
Tried to reroute text to a device that is not connected, is not valid or not hooked
up.
Write protect
Tried to write to a disk that is write protected.
Nahudan, Eiman S.
Dacay, Sheena Mae B.
Bernabe, Dawn Denise
Saguilabon, Jenny
Engr. Heidee Soliman
O.S. instructor
Fin.
Download