This command optimizes the disk performance by reorganizing the files on the disk (new with DOS Version 6).
Syntax for this command is:
DEFRAG [d:] [fF] [IS [:] order] [/B] [f skiphigh [fLCD I IBW I IGO] [/H]
DEFRAG [d:] [fV] [fB] [/skiphigh] [I LCD] I IBW 1/00] [fH]
The options available here are:
/F - Used to defragment files, ensuring that the disk contains no empty spaces between files.
/U - Used to defragment files, leaving empty spaces between files.
/S - Used to control the way in which files are sorted in their directories. Without this option, the current order of files will be maintained. You can use any combination of the following sort options. Do not put spaces between the values.
N Alphabetical order by name.
N- Reverse alphabetical order by name. E Alphabetical order by extension.
E- Reverse alphabetical order by extension. D By date and time, earliest first.
D- By date and time, latest first.
S By Size, smallest first.
S- By size, largest first
/B - Used to restart your computer after files have been reorganized. /skiphigh Used to load DEFRAG into conventional memory, rather than in upper memory.
/LCD - Specifies an LCD color scheme. jBW - Specifies a black and white color scheme.
/GO - Used to disable the graphic mouse and graphic character set.
/H - Used to move hidden files.
You should start DEFRAG only from MS-DOS. Starting DEFRAG from a program such as Microsoft Windows may cause you to lose data. The following is a list of DEFRAG exit codes:
o The defragmentation was successful.
1 An internal error occurred.
2 The disk contained no free clusters. To operate, DEFRAG needs 1 free cluster.
3 The user pressed CTRL + C to stop the process.
4 A general error occurred.
5 DEFRAG encountered an error while reading a cluster.
6 DEFRAG encountered an error while writing a cluster.
7 An allocation error occurred. To correct the error, use the SCANDISK command.
S A memory error occurred.
9 There was insufficient memory to defragment the disk.
Example: If you want to load DEFRAG into conventional memory and run it specifying that the files on drive C be sorted alphabetically by name, enter the following:
defrag c: If Isn Iskiphigh BATCH FILES REM Command
During execution of a batch file, DOS will display (but not act on) comments which are entered on the line after the REM command.
You cannot use separators in the comment except the space, tab, and comma. To keep DOS from interpreting commands in a comment line, enclose the command in quotes. The comment can be any text of about 127 characters.
Example: To add a comment to a batch file, enter
To add a line to a batch file and to keep it from being displayed when the batch file is run, you must first turn the ECHO feature off. To keep the REM comment line from being displayed, enter
echo off rem This comment line will not be displayed




Reply With Quote
Copyright Techfuels
Bookmarks