Anda di halaman 1dari 6

1. Aim: Practice of some internal and External DOS Commands.

DOS is an acronym for Disk Operating System and refers to the PC operating system that existed before Windows (16 bit) or Win 32. This was known as Ms-Dos after Microsoft who wrote it. Command line mode in Windows (accessed by clicking the Start button, then Run, then typing CMD and pressing return ) is often called Dos Mode or the Dos Console by older programmers. DOS applications rarely use the mouse for input, instead relying upon the keyboard for input. INTERNAL COMMANDS These are those commands which are contained in command.com files of MS-DOS. These are those functions that are built into the command interpreter. There is no need of any external file in computer to read internal MS-DOS command. 1. DIR: This command is used to display the files and directories of the current drive and directory. Syntax: DIR [drive:][path][filename] DIR/P: To display files and directories page wise. DIR/W: To display files and directories width wise ( horizontally ). DIR/AD: To display directories only. DIR/AH: To display hidden files only. DIR/AR: To display read only files. DIR/ON: To display files in sorted order name wise. DIR/OS: To display files in sorted order size wise. EXAMPLE: C:\> DIR 2. MD [MAKE DIRECTORY]: This command is used to create a new folder or directory. Syntax: MD [drive:] [path] Where drive is the floppy \ hard disk drive on which you want to create a new directory. EXAMPLE: C:\> MD DRSJS

3. CD [CHANGE DIRECTORY]: This command is used to change current directory to another directory. Syntax: CD [drive:][path] CD.. : This command is used to go to previous directory. CD\ : This command is used to root directory. EXAMPLE: C:\> CD DRSJS C:\DRSJS> C:\> CD.. 4. RD [REMOVE DIRECTORY]: This command is used to remove the directory. SYNTAX: RD [directory] Where directory is the name of the directory which we want to remove. EXAMPLE: C:\> RD DRSJS 5. COPY CON : This command is used to create a new file. SYNTAX : COPY CON [File Name] EXAMPLE:C:\> copy con college Sri Manakula Vinayagar Engineering College. (Approved by AICTE New Delhi & Affiliated to Pondicherry University) Ctrl Z or F6 to save the file. 6. TYPE: This command is used to display the contents of the file. SYNTAX: TYPE [File Name] Example: C:\> type address 7. REN: This command is used to change the file name. SYNTAX: REN [Old File Name] [New Name]

Example: C:\>REN circle area 8. DEL: This command is used to delete the file. SYNTAX: DEL [File Name] Example:C:\>DEL area EXTERNAL COMMANDS These are those commands which are not in-built in MS-DOS. External commands are those which are not included in the interpreter. There is a need of an internal file in the computer to read external MS-DOS command. 1. MEM:-This command displays free and used amount of memory in the computer. SYNTAX:- C:\> MEM the computer will display the amount of memory. 2. SYS:- This command is used for copy system files to any disk. The disk having system files are known as Bootable Disk, which are used for booting the computer. SYNTAX:- C:\> SYS [Drive name] Example:C:\> SYS A: System files transferred This command will transfer the three main system files COMMAND.COM, IO.SYS, MSDOS.SYS to the floppy disk. 3. Move:- Move command is used for moving one file or multiple files from one location to another location or from one disk to another disk. SYNTAX:- C:\> MOVE <file name> <path name> Example:C:\SONGS> MOVE *.MP3 C:\ SONGS\OLD SONGS\

4. CHKDSK:-(Check disk) - This command is used to check the status of a disk and show the report of result status. SYNTAX:- C:\> CHKDSK Example:C:\>CHKDSK
Volume JAI created 10-19-2001 7:14p Volume Serial Number is 3E42-1907 4,203,073,536 bytes total disk space 381,988,864 bytes available on disk 4,096 bytes in each allocation unit 1,026,141 total allocation units on disk 93,259 available allocation units on disk 651,264 total bytes memory 610,784 bytes free

5. SORT:- This command is useful when we want to sort a file. When we run this command the result can be get to display device or file. SYNTAX:- C:\> SORT /R < Input file name> <output file name> Example:Suppose we have a file Player.txt which having the list of a cricket player team and we want to sort the list of players, then we uses this command C:\> SORT Player.txt If we not specify the output file name then result will show to the screen. /R- switch is used for sorting the file in descending order like from Z to A or from 9 to 0.
FIND:- The FIND command is used to search a file for a text string. SYNTAX:- C:\> FIND "String to search" <File name> Example:C:\TEST>find "office" gulab.txt
6.

---------- gulab.txt A clock in a office can never get stolen

7. FORMAT:- This command creates new Track & Sectors in a disk. Every SYNTAX:- C:\> FORMAT [drive name] [/S] Example:C:\> FORMAT A: this command will create new track & sectors. C:\> FORMAT A: /S This command will transfer system files after formatting the disk. 8. DISKCOPY:- DISKCOPY copies the contents of a floppy disk to another. SYNTAX:- C:\> DISKCOPY <Drive1> <Drive2> Example:C:\> DISKCOPY A: B: This command will be copy all contents of A drive to B drive. 2. Aim : Write simple batch program.
A batch program is simply a text file that you can create by using text editor tools, e.g. the EDIT command in MS-DOS. A batch program must be named with an extension BAT, e.g. autoexec.bat, menu.bat It is a program which contains MS-DOS commands. Each command used in the batch file must be started from a new line and written in a correct syntax. The syntax of a command is just the same as that you use it at the DOS prompt. A simple batch program: @ECHO OFF ECHO HELLO HOW ARE YOU? ECHO DISPLAYING THE CONTENT OF CURRENT DIRECTORY DIR ECHO NOW CREATING A NEW DIRECTORY MD GAMES

CD GAMES

3. Aim : File and program management in windows