TOP 09 External DOS Commands with Syntax & Examples

By | January 15, 2022

Hey! DO you want to know External DOS Commands with Syntax & Examples follow this article?

External DOS Commands with Syntax & Examples

External Command in DOS are

DOS commands that are not present in the COMMAND.COM file but are present in other files having the extensions COM, EXE, or BAT are called external commands. Some of the important external commands are explained in the following section.

External DOS Commands

1. EDIT Commands

This command allows the user to view, create and/or modify their computer files. The syntax of this command is given below:

EDIT [/B] [/H] [/R] [/S] [/<nnn>] [/?] [file(s)]

The following table provides a description of some of the important switches of the EDIT command.

/BThis switch forces the file to be opened in monochrome mode.
/RThis switch loads the file in read-only mode.
/?This switch displays the help screen.

2. ATTRIB Command

This command allows the user to change the properties or attributes of a specified file. A file can be assigned the following attributes:

  1. Read-Only : When a file is assgned the read-only attribute, you can only view the file but cannot write to it. The Read-Only attribute of the file is represented as “R”.
  2. Archived : When a fileis assiged the archived attributes,it allows the Microsoft backup and other backup programs to know that a backup of this file needs to be taken. The archived attribute of the file is represented as “A”.
  3. Hidden : When a file is assigned the hidden attribute then it is made invisible to standard users. The hiddenattribute of the file is represented as “H”.
  4. System : When a file is assgned the system attribute then the file is made an important system file. The system attribute of the file is represented as “S”.

The Syntax of the ATTRIB command is given below-

ATTRIB [+R | -R] [+A | -A] [+S | -S] [+H | -H] [[drive:][path]filename] [/s]

in the above syntax “+” is used to assign the attribute and “-” is used to remove the attribute from the file. For example. you need to assign Read-Only, and archived attributes to a file named “data.txt”. To do this you need to use the following command:

ATTRIB +R +A data.txt

Now consider you need to remove the read-only attribute from the data.txt file. In order to do this, you need to use the following command:

ATTRIB -R data.txt

3. CHKDKS Command

This command checks the hard disk of the computer for any errors and displays a status report that consists of a number of files, space left, bad sectors, etc. the syntax of the CHKDSK command is given below-

CHKDSK [DRIVE:][[PATH]FILENAME] [/F] [/V]

The various parameter that can be used in a CHKDSK command is explained below-

  1. Drive : it is the name of the drive, which is generally an alphabetic charecter.
  2. path : it is the location of the directory in the drive.
  3. /F : This parameter is used to fix cross linked errors found on the disk.
  4. /V : This parameter displays the full path and name of every file present on the disk.

4. DELTREE COMMAND

The DELTREE command is a short form for DELETE TREE and is used to delete a directory along with all the subdirectories and files present in it. Generally, when a directory needs to be deleted, you need to empty the content of the directory by deleting the files and subdirectories present in it.

However, when the DELTREE command has been used the files and subdirectories are deleted automatically. The syntax for the DELTREE command is given below

DELTREE [/Y] [DRIVE:]PATH [[DRIVE:]PATH[…]]

The various parameter used in the DELTREE command are explained below:

1. /Y is used to suppress the prompt that is displayed to confirm if you want to delete the subdirectory.

2. [drive:]path represents the drive and the path of the directory that needs to be delted.

for example, in order to delete a folder named Accounts present in C: drive and has some files and folders in it. type the following command-

C:\> deltree accounts

TOP:25 MS-DOS Commands list With Example

TOP 20 Internal Command in DOS with Syntax and Examples

5. FDISK Command

This command allows the user to delete and create partitions on the hard disk drive. The syntax of the command is given below:

FDISK [/STATUS] /X

The various parameters used in the above syntax is given below-

  1. /STATUS– When fdisk command is used with this parameter it dislpays the partiiton information
  2. /X – This switch is used with FDISK Command to ignore the extended disk-access support.

6. FORMAT Command

Format command is used to erase all the information from the storage device such as hard disk drive, floppy disk drive, or compact disk drive. The syntax of the FORMAT command is given below-

format volume [fs:file-system] [/v:label] [/q] [/a:unitsize] [/t:tracks /n:sector] [/c] [/x] [/1] [/4] [/8]

Some of the important parameters used in the format command are explained below:

  1. Volume : it is the drive letter which is assigned for the hard disk drive.
  2. /fs : The type os fiel system to be used for formatting the disk.
  3. /V : This is used to provide a label from the drive.
  4. /q : This parameter is used to perform a quick format on the drive.

Following command with some of the parameters:

Format C:

7. MEM Command

MEM command is used to determine the used and free memory present on your computer. The syntax of the MEM command is shown below-

MEM [/CLASSIFY | /DEBUG | /FREE | /MODULE module name] [/PAGE]

The various parameters present in the MEM command are briefly explained below:

  1. /CLASSIFY or /C – When MEM command is used with this switch it classifies programs by their memory usage. That is the output consists of a list of programs, a summary of the memory in use and lists the largest memory block available.
  2. /DEBUG or /D – When MEM command is used with this switch it dispalys teh status of all modules in memory, internal drivers and other information.
  3. /FREE or /F – When MEM command is used with this switch it dispalys information about the free memory.
  4. MODULEor /M – when the MEM command is used with this switch followed by module name, it displays a detailed listing of that module’s memory use.

8. MORE Command

MORE COMMAND is used to display the output of a command one page at a time if it scrolls to more than one page on the console of the command prompt. The syntax of the MORE command is given below-

MORE [DRIVE:][PATH]FILE NAME

The following example illustrates the use of the MORE command

To display the content of a text file (for eg. Bills.txt) one page at a time, use the following command:

MORE Bills.txt

9. XCOPY Command

This command is used to move files, directories, and even whole drivers from one location to another. The syntax of this command is given below-

XCOPY SOURCE [DESTINATION] [/C | /D] [/D[:DATE]] [/P] [/S [/E]] [/W] [/C] [/I] [/Q] [/F] [/L] [/H] [/R] [/T] [/U] [/K] [/N]

Some of the important parameters used in the XCOPY command are explained below:-

  1. Source : This parameter specifies the file(s) that need to be copied.
  2. Destination : This parameter specifies the location where the files need to be copied.
  3. /D [:DATE] : When this parameter is used you need to specify a date such that only those files or directories that are created on or after that day are copied to the destination.
  4. /P : When this parameter is used with XCOPY command the user is promoted before creating each destination file.
  5. /S : When this parameter is used all the directories and sub directories except empty ones are copied to the destination location.
  6. /E: When this parameter is used all the directories and sub directories, including empty ones are copied to the destination location.
  7. /F : When this parameter is used the full source and destination file names are displayed while copying.
  8. /L : WHen this parameter is used with XCOPY command all the files that need to be copied are displayed.

External DOS Commands in PDF

Click on the below link to download External DOS Commands with Syntax and Examples-

One thought on “TOP 09 External DOS Commands with Syntax & Examples

  1. Pingback: Internal and External DOS Commands with Syntax and Example [TOP 19] - Concepts All

Leave a Reply

Your email address will not be published.