What is MSDOS Operations?

MSDOS Operations 

The MSDOS operating system was one of the dominant operating systems until some years back. It is therefore essential for a person to understand certain operations in MSDOS because these operations from the base of other operations which are a click away in the windows operating system.

Some conventions are used while explaining the syntax of a command:

  • If certain values are included in square brackets [] the values are optional. It means that it can be omitted while issuing the command. Example [-V]
  • The values enclosed within <> and in italics are those values that need to be specified by the user. Example <<drive name>

The MSDOS command can be classified in two categories:

  1. Internal commands
  2. External commands

Internal Commands

MSDOS command for which the specifications are available in COMMAND.COM system file are called external command like DIR, CLS, TYPE etc.

External Commands

MSDOS command for which the specifications are available in form of separate files are called external commands like CHKDSK, LABEL etc.

 

Opening-Screen-of-MSDOS
Opening Screen of MSDOS

Directory Commands

The directory commands are the commands that are required while working with directories. Some common commands are CHDIR, MKDIR and RMDIR

The DIR Command
  • Purpose

The DIR command is used to view the contents of a disk. Figure 2.3 gives the result of issuing the dir.                      command.

  • Syntax

DIR[<drive name>][<path name>][options]

  • Comments
    1.  This command, as can be seen in figure gives the file size, date and time of the creation/modification of the file or the directory.
    2. If <DIR> is included against a name, it means that the name specifies a directory.
    3. This command also gives the disk space occupied by the contents of the directory and the  total free space.
    4. The volume label is displayed in the first line. In this example, it is ITC.
    5. The path name that is specified in the command is also displayed in the third line. In figure it can be seen as Directory of C:\
  • Options with DIR

DIR / P                                                 List the contents full screen at a time

DIR / W                                                List the names of files and directories in multiple Columns.

DIR / AH                                              List the hidden contents

DIR / O [N, S, D, G]                           List the contents in sorted manner of name, size, Date / time,

grouping of files Place (-) sign for descending order

Output of the DIR Command
Output of the DIR Command
The MKDIR or MD Command
  • Purpose

This command is used to make a new directory.

  •   Syntax

MD [<drive name>][<path name>]<directory name>

  •  Comments
  1. Multilevel  directory structure can be created with this command.
  2. Wildcard characters cannot be used with this command
  3. If the drive and the path name are omitted, the new directory is created under the current directory
  • Examples:

MD mydir

MD c:\mydir\dir1

The RMDIR or RD Command
  • Purpose

This command is used to remove a directory from the multilevel directory structure.

  • Syntax

RD [<drive name>] [<path name>]<directory name>

  • Comments
  1. Wildcard characters cannot be used with this command.
  2. If the drive and the path name are omitted, the directory that has to be removed is searched in the current directory.
  3. This command can remove a directory that is totally except for the “.” and “..” shorthand symbols.
  • Examples

RD mydir

RD c:\mydir\dir1

The CHDIR or CD Command
  • Purpose

This command is used to change the working directory.

  • Syntax

CD [<drive name>] [<path name>] <directory name>

  • Comments
  1. The drive and the path name can be replaced by “..”, this means that the working directory will be set to the parent of the previous working directory.
  2. The two dots explained above can be replaced with more dots. The number of dots. The number of dots specifies the number of levels you want to jump to. For example, let use consider that our working directory is “c:\mydir\letters\may”. If we specify “CD..” , then our working directory will be “c:\mydir\letters”. On the other hand, if we specify “CD…”, the working directory will be “c:\mydir”
  3. Wildcard characters cannot be used with this command.
  4. The command “CD\” changes the working directory to the root directory.
  • Examples

CD mydir

CD c:\mydir\dir1

CD..

CD\

File Commands

These are the commands that are used for managing the files. Some common commands are COPY, DEL, REN etc.

The COPY Command
  • Purpose

This command is used to create a new file as well as is used to copy one or more files on the same or different path/disk. Before copy command, the DIR command can be issued to view the contents of the directory. The same can be done after the copy command. It is also used to combine or concatenate contents of two or more files.

Creating a new files:

  • Syntax

COPY CON [<drive name>] [<path name>] <file name>

  • Comments
  1.   The drive and the path name can be ignored if file has to be created in the working directory.
  2. Wildcard characters cannot be used with this command.
  3. The command “COPY CON” overwrites the file if it is already been created and gives an error message if a directory exists with that name.
  • Examples

COPY CON ITC

COPY CON c:\mydir\ITC

 

Copying files:

  • Syntax

COPY [<path name>] <source file name> [<path name>] <destination file name>

  • Comments
  1. Wildcard characters can be used with the copy as and when necessary,
  2. The first parameter specifies the source file(s) that has to be copied. If the path of the source file is omitted then the operating system assumes that the file is in the current directory.
  3. The second parameter specifies the destination file name. If the path is omitted, the destination file is created in the current directory.
  4. The copy command also allows appending files. To do this the files that are to be appended must be separated with a plus (+) sign.
  • Examples

COPY file1.dat c:\mydir

COPY c:\ file1.dat c:\data\file1.dat

COPY names1.txt + names2.txt + names3.txt allnames.txt

 

The TYPE Command
  • Purpose

The purpose of this command is to display the contents one or more text files specified by the drive and pathname.

  • Syntax

TYPE [<drive name>] [<path name>] <file name>

  • Comments
  1. Wildcard cannot be used with this command.
  2. If the type command is used with a file that has tabs. then the tabs are expanded to 8 spaces wide.
  3. This command, when used with binary files, shows strange characters.
  • Examples

TYPE ITC

TYPE c:\mydir\ITC

Output of the TYPE command
Output of the TYPE command
The DEL or ERASE Command 
  • Purpose

The purpose of this command is to delete the file(s) specified by the drive and pathname.

  • Syntax

DEL [<drive name>] [<pathname>] <file name>

  • Comments
  1. Wildcard can be used to delete more than one file at a time.
  2. If *.* is given for file names, then all the files in the path will be deleted. This command will prompt “Are you sure?” before MSDOS  actually deletes the files.
  3. Once deleted, a file cannot be recovered back.
  4. If no path is specified, the file will be searched in the current directory.
  • Examples

DEL ITC

DEL c:\mydir\ITC

ERASE *. tmp

The REN Command

purpose

The purpose of this command is to rename one or more files specified by the drive and pathname.

Syntax

REN [<drive name > ] <file name > <new file name>

Comments

  1. Wildcards  can be used with this command.
  2. This command renames all the files matching the first file name.
  3. This command ignores the pathname specified for the new file name.

Examples

REN ITC try.txt

The Move Command

purpose

The move command is used to move one or more files on the same or different path/disk.

Syntax

MOVE [<path name>] <source file name > [<path name>] <destination file name>

Comments

  1. Wildcard characters can be used with the move as and when necessary,
  2. The first parameter specifies the source file(s) that has to be moved. If the path of the source file is omitted then the operating system assumes that the files is in the current directory.
  3. The second parameter specifies the destination files name. If the path is omitted, the destination file is created in the current directory.

Examples

MOVE file 1. dat c:\mydir

MOVE c:\file 1. dat c:\data\files 1.dat

MOVE names 1. txt + names2.txt + names3.txt allnames.txt

Other commands

There are commands that are to be used for various other purposes. For example, commands are available to set the system date and time, changing volume label etc.

The CLS Command

purpose

This command is used to clear the terminal screen

Syntax

CLS

The DATE Command

purpose

This command is used to set the system date.

Syntax

DATE <date>

Comments

  1. The date that has to be entered must be in the format mm-dd-yy.
  2. The date, month and year can be separated by hyphen (-) or slash(/).
  3. MS-DOS automatically handles the date change and leap years.

Example

DATE

Output of DATE command
Output of DATE command

 

The TIME Command

purpose

This command is used to set the system time.

Syntax

TIME<time>

Comments

  1. The system time can be changed from the DOS prompt or from a batch file.
  2. MSDOS does not prompt for the time when this command is used in the autoexec.bat file.
  3. The time that has to be entered must be in  the format hh:mm:ss:ms A or P.
  4. MS-DOS automatically handles the date changed and leap years.
Output of Time command
Output of Time command

 

Example

TIME

The PROMPT Command

purpose

This command is used to changed the MS-DOS command prompt.

Syntax

PROMPT [<text>] [$<character>…]

Comments

  1. If the text and “$” characters are omitted, MS-DOS changes the prompt to default value that is the default value that is the default drive designation.
  2. The prompt can be customized to suit the user needs.
  3. The following “$” characters are possible:

$    The doller ($) character

T     Current time

D     Current date

P      Working directory of the default drive

V      Version  Number

N      Default drive

G      The “>” character

L      The “<” character

  • Examples

PROMPT My command

PROMPT $p$g

PROMPT $t $d $p $g

PROMPT

The VER Command
  • Purpose

This command is used to display the Operating System Version Number.

  • Syntax

VER

  • Comments

The operating system version is version is a sequence of numbers and characters which denotes the modifications from the previous version.

  • Example

VER

The VOL Command
  • Purpose

This command is used to display the volume identification label of the disk.

  • Syntax

VOL

  • Comments

The volume label of the disk is sequence of numbers and characters which denotes the name or label for the disk.

  • Example

VOL

The LABEL Command
  • Purpose

This command is used to create, change or delete the volume identification label on a disk.

  • Syntax

LABEL [<drive>] [<label>]

  1. Comments
  2. The label name can be up to 11 characters in length.
  3. The label name may have spaces but not contains any symbol.
  4. When the label name is not specified in the command, MS-DOS prompts the user for label name.
  5. If no label is specified, a message appears for Delete current volume label (Y / N)?
  • Examples

LABEL

Output of LABEL command
Output of LABEL command

 

The PATH Command
  • Purpose

When we give a command, the MS-DOS searches for the corresponding executable file in the current directory, it is often the necessity that certain commands need to be given from any directory. The executable file corresponding to these command search path. It means that if the executable file is not found in the working directory, it will be searched in the directories that are listed in the path.

  • Syntax

PATH [<drive name>] [<path>] [:[<drive name>][<path>]…]

  • Comments
  1.  If the options are omitted, this command displays the current path.
  2. Null path can be set by the command path.
  • Examples

PATH=c:\windows; c:\windows\command

PATH;

The PRINT Command 
  • Purpose

The purpose of this command is to print a text file on a printer.

  • Syntax

PRINT [<drive>] [<pathname>]<filename> [/d:<device name>]

  • Comments
  1. Wildcard can be used with this command.
  2. This command prints a file in the background. Other commands can be issued after issuing the print command.
  3. The print command prints to the printer attached to the computer by default. The /d option can be used to prompt the user to enter the print device. If no print device is specified, the default device PRN, which is the first parallel printer connected to the computer, is used.
  • Examples

PRINT myprog.c

PRINT c:\mydir\myprog.c

 

 

 

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top