Internal & External Command

 Internal command - The commands which are part of command.com are known as internal commands. all internal commands are loaded into the memory automatically during the booting process.

e.g.     dir, date, time, ver, vol, label etc.

there are many internal commands:- 

cd : - cd or chdir stands for change directory. It is an internal command. It is the most frequently used command. it is used to change the working directory.   

e.g……

  •   c:\>cd directory name [Enter]

  •   c:\>cd..  (It moves one level back to the parent directory.)

  •  c:\>cd\  (It moves to the root directory from any logged sub directory.)

 md : - md or mkdir stands for make directory or sub directory.

e.g………. c:\>md amit (Enter)

RD:- rd or rmdir stands for remove directory. This command is used to remove a particular directory or subdirectory from a disk. Only an empty directory or subdirectory can be removed.

e.g……      c:\>rd amit (Amit)

CLS:- It is basically used to clear all the information from the display screen.

e.g.          c:\>cls (Enter)

COPY :- This command is used to copy the contents of one or more specified files to another disk or same disk with the same or different file name.

e.g.             c:\>copy c:\>file one (Source file)

                   c:\>file two (Target file) [Enter]

COPY CON :- This command is basically used to create a file. 

e.g.   c:\>copy con filename.extension name(Enter)

DATE :- This command is used to view the system date. Date as maintained by the DOS. It is also used to change the current date to that entered by the user.

e.g.      c:\>date(enter)

REN :-  This command is used to change the name of an existing file.

e.g.        c:\>ren amit vicky [Enter] (It will rename amit to vicky)

TYPE :- This command is used to display the content of a file on the screen & optionally on the printer too.

e.g. c:\>type abc.txt (Enter)  (It will shows us the contents of the file abc.txt)                               

Any command to known more :- c:\>help (in this use)


BATCH FILE :-

A batch file is a program which containsMS-DOS commands. Each command used in the batch file must be started from a new line & written in a correct syntax.

                       A batch file must be named with an extension .bat

e.g.            autoexe.bat,  menu.bat

The syntax of a command is just the same as that you use it at the DOS Prompt.


@ echo off

Title my first batch file.

echo Hello!

pause


echo This is the first line.

echo This is the second line.

Pause


@ echo off

Title second lesson

Start iexplore.exe http://www.google.com


External Command:-  The commands which are saved on the disk in the form of individual files are known as external commands.

                                                       These commands are not automatically loaded into the memory when we use them first they are loaded into the memory then they execute.

e.g. xcopy, Disk copy, TREE, FORMAT.

  • The external commands are used less frequently & are stored in some external files which are stored in some secondary storage device.

  • All executable files with extension .com, .exe & .bat are the external commands.

  • Some of the common external commands are format, move, attrib, more, chkdsk,  & tree etc.


Attrib :- This command is stored in attrib exe file. which is needed for its execution.

             This command is used to set attributes like read only, hidden, archive for a    

              normal file. It displays sets or removes the attributes.

e.g.      

  •  c:\>attrib path name attributes (Enter)
  • c:\>attrib autoexe.bat +R (Enter)[This command makes the file read only]
  • + For sets an attribute
  • - For clears an attribute
  • R For read only file attribute
  • S For system file attribute
  • A  For archive file attribute
  • H  Hidden file attribute

Backup :- This command requires backup.exe to be executed. This command is basically used to restore the various files that are stored on the hard disk.

Chkdsk :- It requires a chkdsk.exe file for its execution. This command scan the disk in a specified drive for error. It reports that in the status report. It returns information about volume serial number, total disk space, space in hidden files, space in directories, space available on disk, number of bytes in each allocation unit etc.

e.g.              c:\>chkdsk (Enter)

Deltree :- It requires deltree.exe files for its executions. This command is used to delete all the files & directories in the current directory completely.

e.g.      c:\>deltree a:\amit\*.* (Enter)  [It will delete all the files in amit directory]



FC Command:- This command is used to compare the two files.
Syn:- C:\>FC>File1><File2>

Sort:- This command is used to show the content of file in ascending or descending order.
Syn:- C:\>sort<File name>(enter) [For ascending order]
C:\>sort/r<File name>(Enter) [For Descending order]

Find:- This command is used to find the string in the file.

Syn:- C:\>Find'string name'<File name> (Enter)

XCopy:- This command is used to copy the file from one directory to another directory.
Syn:- xcopy<source><destination> (enter)

No comments:

Post a Comment