You are on page 1of 6

Internal vs.

External
• Internal • External
– DATE – FORMAT
– FDISK
DOS COMMANDS – TIME
– VER – SYS
– PROMPT – ATTRIB

You will use these more than you think! – PATH – COPY
– DIR – XCOPY
– CD, MD ,RD – DELTREE
– DEL
– EXIT

Internal DOS Commands External DOS Commands


• Only need the “basic three” to be active • Always need the “basic three”
• All contained within COMMAND.COM • All require that an executable file by that
• No need for PATH statement name is available for use
• No need for CONFIG.SYS • PATH statement frequently necessary
• No need for AUTOEXEC.BAT • Usually do not need CONFIG.SYS
• Usually do not need AUTOEXEC.BAT

DATE MM-DD[-YY] TIME HH:MM[:SS[.XX[A/P]]]


• Used to set the CMOS date on the computer • Used to set the CMOS time on the computer
• Occurs at the point of the <cr> • Occurs at the point of the <cr>
• Stored in the CMOS as the number of
• Stored at the number of milliseconds since milliseconds since about 1980
about 1980 (32 bit clock will last till some time in 2020s)

• For HELP type DATE /? • The HH must be on 24 hour basis


• The XX above are for hundredths of seconds and
is optional
• The A/P (AM/PM) designation is optional.

1
VER PROMPT [ PARAMETERS]
• Displays the current version number of DOS • Usually set to:
• No parameters – $P – to give the current directory
– $G – to give the “greater than” symbol after the
current directory
• Check out PROMPT /? To get other
parameters.
• Demo

PATH [;] or PATH= [path1][;path2] [etc..]

• No Parameters—display the current path


DIR [ PATH] [SUBSET]
specification
• Path – may refer to any disk and directory
• Only the “ ;” mark—erase the current path
• Subset – only displays files and directories
specification
that match the “subset criteria.”
• Otherwise:
• Wild cards frequently used
– Look first in path1
– Then in path2
• Demo
– Then is subsequent listed paths in the specified
order.

Making a Directory
Interesting DOS Questions MD [path\]name[\]
(or MKDIR)
• What happens when one does: • Used to create a new directory
– DIR C: vs. DIR C:\ ? • Path\ when not present is assumed to be the
– Why current directory
– Can one do a DIR on the a: drive from the c: • Do not have to be within the directory
drive? where new directory will reside
– What is the difference between a DIR C: from
the D: drive and a DIR C:\ from the D: drive?

2
Remove Directory CD PATH
RD [path\]name[\] (CHDIR)
(or RMDIR)
• Used to switch from the current directory to
the directory described in the path part of the
• Used to delete or remove the directory name statement.
• When Path\ not present is considered to be
• Valid abbreviations (for all directory
the current directory commands):
• Can not delete directory with any contents – Single dot . —relative to current directory
• Do not have to be within the directory being – Double dot .. —relative to parent directory
removed – Back slash \ — The preceding is either the root
directory or a directory name

Wildcards—when referring to filenames


DEL [ PATH\] FILENAME • The ? Character: –may be used to represent any
single valid character for inclusion in the
• Deletes the file(s) described by filename specification. Example: DIR ab??c.txt
• Wildcards frequently used here • The * character:
• Once deleted files are frequently possible to – To the left of the filename dot: The * character is
“undelete” assumed to be representing any and all
combinations of characters to its left including
itself.
– To the right of the filename dot: The * character is
assumed to be representing any and all
combinations of characters to its right including
itself.

EXIT External DOS Commands


• Will close current window if running in a • Need the “Basic 3” plus
window • Also need the specific executable file
• Will close current DOS shell if active
• May need PATH in AUTOEXEC.BAT
• Will NOT close the root or primary DOS
– Where are the DOS commands in WINDOWS?
shell
– How would one issue DOS commands with and
• In older versions also included the STOP without the PATH statement
function
• Demo –

3
Help with DOS External
External DOS Commands
Commands
• FORMAT • SCANDISK • From the command prompt in WINDOWS:
• FDISK • CHKDSK – Command name /?
• SYS • DELTREE – This will list the various switches and options
• ATTRIB • DEFRAG – Note: c:\windows\command must be within the
• COPY • DEBUG path specification.
• XCOPY • DISKCOPY • From the command prompt in older DOS:
– HELP [DOS COMMAND NAME]
– The Help file and the QBASIC.EXE are necessary

FORMAT
FDISK
• Used to make either floppies or hard disks
usable by DOS • Used to partition a hard disk
• Creates on the disk: • Creates and writes to Hard Disk two copies
– Master Boot Record—“Size media” of the “partition table”
– Sectors, tracks and cylinders • Undocumented /MBR switch to restore
– Fills Clusters with F6h and numbers them backup copy of partition table
– Two copies of the FAT table
– Root directory

SYS [DRIVE1 PATH1] DRIVE2 ATTRIB +or- attribute [ path\] filename

• Used to transfer current “Basic 3” OS files • Possible attributes:


found on DRIVE1\PATH1 to the device – Hidden—not seen with DIR command
Named as DRIVE2 – System—system file, can not be deleted
– Read only—cannot be changed
• The disk (Drive2) should then be bootable – Archive—file has changed since last backup
• If a floppy, the disk usually needs to be • Path – The path to filename file
completely blank first • Filename – The file with attributes
• Same effect when FORMAT DRIVE2 /S – (wildcards used frequently)
switch used • DEMO

4
COPY filename1 filename2 XCOPY or XCOPY32
• Both filenames may have a path given • Used to copy entire directories &
• No path implies the current directory subdirectories
• filename1 is the source file copied • Will copy hidden files with /H switch
• filename2 is the destination filename • Check /? Switch to get full switches
• Wildcards frequently used
• Lots of other switches /?

DISKCOPY SOURCE DESTINATION SCANDISK


• SOURCE—Source drive (A:) • Used to correct errors in FAT
• DESTINATION—Destination Drive (B:) • Cleans up and corrects problems
• Makes an exact copy hidden files, errors • Runs in both WINDOWS and DOS
and even corrupt files
• Copies Disk Image
• Possible to do DISKCOPY A: A:

CHKDSK DELTREE
• Like SCANDISK but only runs in DOS • Used to delete an entire directory & all of
• Can find errors, but does not fix them its sub-directories
• A legacy from older DOS • Powerful but dangerous
• Be careful with this one!

5
DEFRAG DEBUG
• Used to make a hard disk run faster • Used to manipulate and view very specific
• Causes all clusters of a file on a hard disk to parts of memory or disks
be contiguous • Discussed later in this course.
• May take a lot of time!

End

You might also like