Types of External Commands in MS-DOS
1. attrib
Change or view the
attributes of one or more files. It defaults to displaying the attributes of
all files in the current directory.
Options:
- To add an attribute attach a '+' in front of it.
- To remove an attribute attach a '-' in front of it
- Attributes include
- R - Read-only
- A - Archive
- S - System
- H – Hidden
Syntax:
C:\>attrib [+|-ahrs] [file spec]
Directory Attrib Functions: It is also
possible to use ATTRIB across directories.
[drive:][path][file name]
Specifies a file or files
for attrib to process.
- /D - Process folders as well.
- /S - Process matching files in the current folder and all subfolders.
2. backup and restore
Programs to back up
and restore files from an external disk. These appeared in version 2, and
continued to PC-DOS 5 and MS-DOS 6 (PC-DOS 7 had a diversion check).
In DOS 6, these were
replaced by commercial programs (CPBACKUP, MSBACKUP), which allowed files to be
restored to different locations.
3. chkdsk
Verifies a storage
volume (hard disk, partition, floppy disk, flash drive, etc)
for file system integrity.
Options:
- /F : Fixes errors on the volume (without /F , chkdsk only detects errors)
- /P : Forces a full verification
- /R : Searches for defective sectors and recovers legible information (applies /F)
- /X: Unmounts the volume before processing if needed. (Note: An mounting temporarily invalidates all pointers/handlers to the volume until process is completed)
Syntax:
C:\>chkdsk volume letter:
[[path]file name] [/F] [/P] [/R] [/X]
4. defrag
Options:
·
-A – Analyses the
fragmentation of a disk drive
·
-F – Force
defragmentation even if disk space is low
·
-V – Verbose output
mode
·
-H – Defrag hidden
files
Example of usage:
Defrag drive letter: -a -v
5. deltree
Deletes a directory
along with all of the files and subdirectories that it contains. Normally, it
will ask for confirmation of such a drastic action.
Deltree [/y] directory
The /y parameter, if present, tells the
deltree command to carry out
without first prompting for confirmation.
The deltree command is not included in recent Microsoft Windows operating systems.
Deleting a non-empty directory in those versions of Windows where the command
is not included can be achieved by using the rmdir command as in the following example:
Rmdir /s [/q] directory
6.edit
Full-screen text
editor, introduced in MS-DOS
Sntax:
C:\>Edit filename
7. fc or comp
Compares two files or
sets of files and displays the differences between them.
FC [/A] [/C] [/L] [/LBn] [/N] [/T] [/W]
[/nnnn] [drive1:][path1]filename1
[drive2:][path2]filename2
FC /B [drive1:][path1]filename1 [drive2:][path2]filename2
/A Displays only first and last lines for
each set of differences.
/B Performs a binary comparison.
/C Disregards the case of letters.
/L Compares files as ASCII text.
/LBn Sets the maximum consecutive mismatches to the
specified number of lines.
/N Displays the line numbers on an ASCII
comparison.
/T Does not expand tabs to spaces.
/W Compresses white space (tabs and spaces)
for comparison.
/nnnn Specifies the number of consecutive lines that
must match after a mismatch.
[drive1:][path1]
filename1 Specifies the first file or set of files to compare.
[drive2:][path2]
filename2 Specifies the second file or set of files to compare.
.
8. fdisk
Manipulates hard disk
partition tables. The name derives from IBM's habit of calling hard drives fixed
disks. When run from the command line, it displays a menu of various
partitioning operations:
1. Create DOS partition
or Logical DOS Drive
2. Set active partition
3. Delete partition or
Logical DOS Drive
4. Display partition
information
5. Change current fixed
disk drive (only available if the computer has more than one hard drive)
FDISK /MBR installs a
standard master boot record on the hard drive.
FDISK /MBR #: where #
is other partition on system. Completes above command on indicated partition.
eg: "C:\FDISK /MBR
D:" would install boot record on D:\ partition.
9.find
A filter to find
lines in the input data stream that contain or don't contain a specified string
and send these to the output data stream.
Find may also be used as
a pipe.
Syntax:
C:\>find "keyword" <
''input filename'' > ''output filename''
Searches for a text
string in a file or files.
FIND [/V] [/C] [/N] [/I]
"string" [[drive:][path]filename[ ...]]
/V Displays all lines NOT containing the
specified string.
/C Displays only the count of lines
containing the string.
/N Displays line numbers with the
displayed lines.
/I Ignores the case of characters when
searching for the string.
"string" Specifies the text string to find.
[drive:][path]filename
Specifies a file or files to search.
10. format
Delete all the files
on the disk and reformat it for MS-DOS
In most cases, this
should only be used on floppy drives or other removable media. This command can
potentially erase everything on a computer's hard disk.
/autotest and /backup
are undocumented features. Both will format the drive without a confirmation
prompt.
Syntax:
c:\>format [options] drive
c:\>fORMAT drive: [/V[:label]] [/Q]
[/F:size] [/B | /S] [/C]
11. help
Gives help about DOS.
MS-DOS
Help 'command' would
give help on a specific command. By itself, it lists the contents of
DOSHELP.HLP. Help for a specific command invokes the command with the /?
Option.
12. more
Pages through the
output so that you can view more than one screen of text.
command | more
13. move
Moves files or
renames directories.
Syntax:
C:\>move filename newname
C:\>move drive letter:\older drive
letter:\newdir
Example of usage:
C:\>move c:\old c:\new
14. print
Adds a file in the
print queue.
Options:
- /D device: Specifies the name of the print devices. Default value is LPT1
- /P filename : Add files in the print queue
- /T : Removes all files from the print queue
- /C filename : Removes a file from the print queue
This command was introduced in MS-DOS
version 2. Before that there was no built-in support for background printing
files. The user would usually use the copy command to copy files to LPT1.
15. scandisk
Disk diagnostic
utility. Scandisk was a replacement for the chkdsk utility, starting with later versions
of MS-DOS. Their primary advantage over chkdsk is that it is more reliable and
has the ability to run a surface scan which finds and marks bad clusters on the
disk. Chkdsk had surface scan and
bad cluster detection functionality included, and was used again on Windows NT
based operating systems.
16. sort
A filter to sort lines in the
input data stream and send them to the output data stream.
C:\>sort < input filename >
output filename
17. undelete
Restores file
previously deleted with del. By default all
recoverable files in the working directory are restored. The options are used
to change this behavior. If the MS-DOS mirror TSR program is used, then deletion
tracking files are created and can be used by undelete.
Syntax:
C:\>undelete [filespec] [/list|/all][/dos|/dt]
18. xcopy
Copy entire directory
trees.
Xcopy is a powerful version of the copy
command with additional features; has the capability of moving files,
directories, and even whole drives from one location to another.
Syntax:
C:\>xcopy directory [destination-directory]
19. load fix
Loads a program above
the first 64K of memory, and runs the program.
Syntax:
C:\> loadfix [drive:] [path]file name
Comments
Post a Comment