Monday, 17 June 2013

Types of internal commands in MS-DOS

1.  cls
cls is an internal command. It is basically used to clear all the information from the display screen, bearing only the system prompt and a cursor on the upper left corner of the screen.
The syntax for writing cls command
It will clear the entire display screen and previous command would not be seen. It will display operating system prompt, if any, on the first line of the display.

2.  copy con
Copy con is an internal command. This command is basically used to create a file. The only disadvantage of this command is that the file created by this command cannot be modified. If a user tries to do it then a message is displayed whether user wants to overwrite already existing file or not. There is no cursor upward or backward movement by using arrow keys when we use this command to make multiline file.
The general syntax of this command is
c:\> copy con <filename>
 3. cd or chdir
      Change current directory. Displays the current working directory when    used without a path parameter.

4. copy
Copies files from one location to another. The destination defaults to the current directory. If multiple source files are indicated, the destination must be a directory, or an error will result.

c :\> copy file spec [destination]

5. del or erase

Deletes one or more files.
c:\>del filename

 6. dir
The dir command typed by itself, displays the disk's volume label and serial number; one directory or filename per line, including the filename extension, the file size in bytes, and the   date and time the file was last modified; and the total number of files listed, their cumulative size, and the free space (in bytes) remaining on the disk. The command is one of the few commands that exist from the first versions of DOS.

      c :\> dir [drive:][path][filename]
        Most commonly used parameters of dir include:
  • /W: Displays the listing in wide format, with as many as five filenames or directory names on each line.
  • /P : Pause at every page
  • /S : Also look in subdirectories
  • /B : Uses bare format (no heading information or summary)
  • /D : Display wide format but sorted by column
  • /L : Display forced into lowercase
  • /N : Display forced into long file name format instead of 8.3
  • /Q : Displays the owner of each file
  • /X : Display shows 8.3 names next to long file names

7. exit
Exits the current command processor. If the exit is used at the primary command, it has no effect unless in a DOS window under Microsoft Windows, in which case the window is closed and the user returns to the desktop.
c :\>  exit


8. md or mkdir

Makes a new directory. The parent of the directory specified will be created if it does not already exist.
            c:\>md directory name
            c:\> md subdirectory name

9. rd or rmdir
Remove a directory, which by default must be empty of files for the command to succeed (the /s flag removes this restriction).

            c:\> rd root directory    (in case of root                      directory)
                c:\>rd subdirectory    (in case of subdirectory)

10. ren
Renames a file. Unlike the move command, this command cannot be used to rename subdirectories, or rename files across drives.
               C:\>ren filename new name

You can rename files in another directory by using the PATH parameter:
             C :\> ren [path]|[filename] [new filename]

11. time and date
Display and set the time and date
When these commands are called from the command line or a batch file, they will display the time or date and wait for the user to type a new time or date and press RETURN. The command 'time /t' will bypass asking the user to reset the time.

12. tree
Shows the directory tree of the current directory
c :\> tree [options] [directory]

  • /F (Displays the names of the files in each folder.)
  • /A (Use ASCII instead of the extended characters.)
  • /? (Shows the help)

13. type
·         Display a file. The more command is frequently used in conjunction with    this command, e.g. type long-text-file | more.
      C :\>type filename

14. ver
·                      Shows the version of MS-DOS you are using.
·                      Some versions of MS-DOS support an undocumented /r switch, which     will show the revision as well as the version.

No comments:

Post a Comment