Choose Your Language
MS-DOS-Part-21-A-command line basic overview | HARTRON EXAM

MS-DOS-Part-21-A and command line basic overview

MS-DOS Commands

MS-DOS Commands
MS-DOS Commands

The dos command is the specific program that ensures the smooth selection of a computer. There are many different commands in Dos and each command has a certain and desired function.

MSDos has two types of commands.

Internal commands

Internal commands are loaded into memory as soon as Dos starts. Because these commands remain in memory, they are always available for use, although when the disk directory of user file names shows on the screen, it is not visible. Some internal commands of Dos are: DIR, COPY, DEL, MD, CD, CLS, TIME and TYPE.

DIR:

List of all files as soon as you type DIR, the current directory, all sub directories will be displayed. If you want a special directory, you can search from the stored fruits. If you type the letter of the disk drive, then you can see the contents of other disks as well. But after typing the disk drive letter you need to put a colon (:) after this command.

The COPY:

copy command is used to copy one or more files to the same directory in another directory or another disk. After typing the copy command, give the full pathname of the file you want to copy and the full pathname of the directory from which you want to copy it. If you want to duplicate an entire file in the same directory, then it has to be copied to another name than its original name.

DEL:

After typing Del, renaming the file deletes the file, which will save more space on your hard disk or floppy disk.

MKDIR OR MD:

When you want to create a new directory on disk, after typing MKDIR or MD, type the name of the directory you want to create.
CHDIR OR CD: Use the cd command to display the name of the drive and directory you are currently working on. If you want to change that directory to another directory then type the pathname of the second directory by typing CD. To access the root directory, put a backspace (/) after the CD.

The CLS:

CLS command is used to clear the screen and move the command prompt above it.

DATE:

From DATE you get the date which is recorded by the PC’s internal calendar. If it is wrong then you can correct it.

With the TIME:

Time command, the time triggered by the PC’s internal clock will appear on the screen. You can also change this time. But if true, just press enter.

TYPE:

Through this TYPE command all the contents of a text file can appear on your screen but after the type command type the file name as well.

External commands

External commands
External commands

This command is not available internally in Interpreter ie Command.com I. These external commands are like small programs that are designed to facilitate a particular task. It is important to have special files in turn of these commandos. These specification files have the same primary name as the command and extension – like com or .EXE, but the commands given here will work in the system only when the specification files are available in the system.Otherwise the file not found error message will appear on the screen. Some external commands of DOS are:
CHKDSK, FORMAT, XCOPY, PRONT, TREE and DISC COPY.

CHKDSK:

Use CHKDSK when you want to know the status (current state) of hard disk and floppy. MS-DOS will tell you how much disk space is there, how many files are in the disk, and whether some parts of the disk are damaged.

FORMAT:

You use this command to format a floppy disk so that it can work with MS DOS. After FORMAT, type the name of the disk drive that contains the disk that you want to format. Then put a colon (:).

XCOPY:

XCOPY is the same as the command copy but does a faster job. It is used to copy directories and subdirectories.

PRONT:

can print the file by this command.

DISC COPY:

By this command, duplicates of comments can be made from one floppy disk to another floppy disk. The disk to be copied may be formatted or unformatted, but must have the same size and capacity as the original disk.

TREE:

This command is used when displaying the entire directory, including the tree structure below the current directory. If used in the root directory of the disk, the entire structure of the disk is displayed.

MEM:

It shows on your computer how much memory is used and how much is empty. Allocated memory area, Yh memory area and programs that have been recently filled in memory will be displayed using MEM.

ATTRIB:

Sometimes there is a desire that the file should not be a victim of any sudden change or deletion, so it should be saved. Similarly, a user may also wish that a file be kept hidden in such a way that the DIR command is not brought on this screen. ATTRIB is used for such tasks.

BATCH PROCESSING

BATCH PROCESSING
BATCH PROCESSING

So far, we have understood that once a mand user has to PROMPT the same command, press enter key. But if several commands are completed automatically at the same time, a batch file should be created for that. A batch file is an unformatted text file, with the help of it executes DOS commands one batch at a time. DOS’s batch files must have a file extension, such as .BAT. To execute a batch file, the user has to type only the primary filename and press ENTER.It is also important to take care that if there is an external DOS command in the file then give it with the directory of the correct path which contains the DOS files.

It is easy to create a batch file by an editor on the screen, or a command can also be given to create a batch file. To create a batch file named diamond.bat, the copy command should be written like below.
COPY CON DIAMOND.BAT

Here CON is the device name for the keyboard, ie CON (Keyboard) is the source of information. Commands typed on the keyboard will star in DIAMOND.BAT. After this command, as soon as you press enter, the cursor moves to the second line from where you can start typing the DOS command. To end the file, press CTRL + Z and press enter. For example, suppose we have to create a batch file from the very beginning that will execute some DOS commands.
C:>copy con diamond.bat
cls
Type xyz.doc
Copy abc.txt a:\
^z

When the editing of your batch file is over, press CTRL + Z and after pressing CTRL + Z, a message will appear on the screen as shown below.
1 file (s) copied
This means that your batch file has been created.
Now that your batch file has been created, we will simply type the file name of that batch file and press Enter on the prompt.
C: > test

Leave a Reply

Your email address will not be published.

%d bloggers like this: