Thursday, May 17, 2007

Use of MS DOS Commands:

In this age of Windows, we do not use MS-DOS Commands in day-to-day use, but the system administrators or network people need to use these commands frequently.

For common people, when there is a virus attack on the system or system gets corrupted and they need to format the hard disc or reinstall the operating system, then MS DOS Commands prove very useful. You can access the drives of your hard disc and run set up, find keys or save your valuable data using these commands very easily.

Friday, November 10, 2006

MS DOS COMMANDS

MS DOS Commands stands for Microsoft Disk Operating System Commands written by Microsoft Corporation, USA. It is useful for smooth function of a computer System. CPU is (Central Processing Unit) the heart of the Computer Hardware. Operating system is the heart of the computer software.

DOS and its components:

DOS Commands have been broken up into three parts.

The first part of the operating system is in two files at the beginning of the storage area on the disk. The first file is the IO.SYS. It deals with the Input/output tasks to the base devices.

The second hidden file is MSDOS.SYS. It is the program that interacts with the user. It operates by communicating directly with the IO.SYS or the MSDOS.SYS files.

MS DOS commands are mainly categorized under two heads; Internal commands or Resident Commands and External Commands and External commands or Transient commands.

Internal Commands: - An Internal command is a part of the operating system. Therefore, this sort of commands is not a separate file on the disk and can be accessed at any time. That is, as long as COMMAND.COM i.e. the command processor that has been load on.

External Commands: - An External Command is a file or a program that is on the disk (usually under the DOS directory) and if not present, that command cannot be executed.

We shall first have a look at a few of the internal commands and then go on to the External commands.

INERNAL COMMANDS:

1) DIR:-

DIR command and be used to list the contents of the current directory or specified directory and its subdirectories.

E.g. DIR

The directory display includes the filename, the file’s size in bytes, the date and the file was updated, and the amount of free space remaining on the disk. DIR command displays the names of directory entries except those whose attributes mark them as hidden or system.

Sometimes you want to look at only those directory entries that have, or do not have. Certain attributes, to do this /A (attribute) option is available.

E.g. DIR/A

It displays all files including hidden and system files. One or more letter can be used with /A attribute for following requirements.

E.g. DIR/AD

D It displays subdirectories only.
R It displays read-only files.
H It displays Hidden files.
S It displays System files.
A Files ready to archive.
- If preceding an attribute, means do not display files with this attribute.

E.g. DIR/A-D

It displays files only.

/0 attribute displays files sorted. By default, it will sort on name if no order is specified. All sorts are in ascending order unless preceded by the character in which case the sort reversed.

Order Meaning
DIR/N By name (default if no order is specified)
DIR/S By size.
DIR/E By Extension.
DIR/D By date and time.
DIR/G Group directories first.
- Perform sort in descending order.
DIR/S Displays files in specified directory and all subdirectories
DIR/L Displays list in lower-case (default is uppercase)
DIR/P Pause display after each screenful
DIR/W Display files in wide format (without any file details and four filename a line)

2) WILD CHARACTERS
Most of the commands in DOS operate on files. Files have names to identify them from the others. Hence, filenames should be unique within the current directory.

When we give command using a filename, we can only manipulate that file alone. Can we operate on a group of files rather than a single file? Yes, DOS, allows us to do this also. If we want all filenames which contain certain specified characters, we can replace the bother characters by a special character. These special characters are termed as replacement characters or wild characters. While matching. DOS ignores those characters in actual filenames, where these special characters have been specified.

The following are wild characters used and their characteristics:

GLOBAL REPLACEMENT

Wherever * occurs in primary name or extension it specifies all the characters to be ignored.

E.g. i) DIR*.*

After the command has been executed all files on the floppy will be listed.

ii) DIR RP*.*

On execution of this command all files that begin with RP will be listed.

iii) DIR *.A

All files with the extension A will be listed.


SINGLE REPLACEMENT. (?)

The location where “?” occurs in a filename will be ignored.

E.g. i) DIR ??P??A.??E

All the files which meet the following particulars would be listed:

a. The primary name should contain only 6 characters.
b. The 3rd character should be “P”
c. The 6th character should be “A”
d. The secondary name should contain 3 characters.
e. The 3rd character in the secondary name should be “E”

ii) DIR ?.?

since ? is a single replacement character, all files having filename and extension with single character each, will be listed.

iii) DIR A?.EXE

All files with two letters in the primary name which begin with A and have an extension EXE will be listed.

iv) DIR ?A?.*

File name width should be of three characters.
Middle character should be ‘A’.
Extension may be any thing will be listed.


3> MKDIR or MD :-

To create a new directory, you use the make directory command.
It is typed either as MKDIR or MD. E.g. you would add a directory named LETTERS to the root directory with this command.

MD LETTERS

Every directory or sub-directory contains two special files (.) and (...). These are the system files.

In directory other files or directories can be placed. Within particular disk or partition, all of the names in one directory names of files, or names of subdirectories – must be unique. But the same name can be used in other directories.

4> CHDIR or CD

When you start DOS. You’re in the root directory. In other words, root directory is the current directory. Even though you have made sub-directories, you have not changed the current directory yet. We can enter the sub-directories by using CHDIR command. CHDIR is used to change the current directory to the one you want to work in or to display its path.

When CHDIR or CD is entered without any parameters, the path of the current directory is directory is displayed. When a directory name is specified after CHDIR or CD, the current directory will change to the sub-directory from its current directory. E.g.

cd invfile

In the preceding example, the CHDIR command will chance the current directory to INVFILE.

CD/ A - This command will change the direction to the root directory from any sub-directory.

CD.. - This command will change the directory to the parent sub-directory.


5> RMDIR or RD :-

With this command directory can be removed. E.g.

RD LETTERS

To be able to use this command on a directory. The directory must first be empty. It should contain no files or any other directory entries. If you try to delete a directory that contains any files or subdirectories. DOS display the informative message :-

INDIRECT PATH, NOT DIRECTORY OR DIRECTORY NOT EMPTY.

6> CLS :-

This is an easy command to remember. It everything from the screen and moves cursor to the top left hand corner of the screen, right after the prompt.

7> COPY :-

Makes a copy or duplicates a file or files from one location to another.

a) COPY A : THISFILE B:
In this example DOS tells to copy a file named THISFILE from the diskette in drive A to the diskette in drive B:

b) COPY A:*.* B:
It copies all the files from drive A to drive B.
You can use both characters and wild cards in a file name E.g. You could copy all the files that begin with the letters XYZ like this

COPY A:XYZ*.* B:
Following is the basic form of copy command
COPY drive:filename drive:

c) COPY THISFILE THAFILE

Here the first file specified is the source file. The second file specified is the target file. It would make a copy of a file name THISFILE, and the copy would be named THATFILE at the same disk or drive. If you want to copy it from drive A to B following is the command

COPY A: THISFILE B: THATFILE

d) Suppose you have two files. XX & YY and you want to combine their contents into another file ZZ then following is the command

COPY XX+YY ZZ

8> DEL or ERASE :-

If you can duplicate files with copy, you can intentionally removes files as well. So it deletes one or mare files.

a) You can delete all the files using wildcard E.g. DEL *..
Dos will ask – are you sure (Y/N) ?
This is the protective side that, DOS ask you question if you mistakenly gives the command

b) DEL *.BANK or ERASE *.BAK
This will delete all the files having the extension BAK

C) ERASE THISFILE
The above command deletes the file THISFILE.

9> RENAME or REN :-

This command is useful to change the name of a file. REN, short for RENAME. So the format is

REN old-name new-name

a> E.g. you had a file named DRAFT and you wanted to change the name to FINAL
then:- RENAME DRAFT FINAL is the command.

b> E.G. Like other commands, you can use wildcards :-
REN *>XXX *.YYY
You could change every file with an extension of XXX to YYY.

10> DATE:-
The DATE command is used to enter or change the system date. This date is recorded in the directory entry for any files which are either created or modified.

E.g. date

The following message is displayed

Current date is (Tue 1-07-1980)

Enter new date (mm-dd-yy):

Valid entry for date is mm-dd-yy, where mm is for month, dd for date, yy is for year. Valid month are from 01 to 12, and valid dates are from 01 to 31.

An invalid entry will result in the following message

Invalid date

Either the hyphen (-) or the slash (/) can be used while entering the date.

11> TIME :-

The TIME command allows the user to change system time.

E.g. time

The following message is displayed:

Current time is (hh:mm:ss:fs:)
Enter new time (hh:mm:ss:fs)

Valid format for entering time is
hh:mm:ss:fs.
hh = hours ranging from (01-24)
mm = minutes ranging from (00-59)
ss = second ranging from (00-59)
fs = fractions of seconds

NOTE:

The colons separate the hours, minutes, and seconds while a period separates seconds and fractions of seconds.

12> TYPE:-

Type is handy way to get a quick look at the contents of a file on the screen. The output can also be directed to the printer if required.

E.g. TYPE ABC.TXT

This will display the contents of the fie ABC.TXT

13> VER (Version):-

Displays the current version and revision of DOS begin run. A message usually appears when the command processor loads on. VER/R – The /R switch also gives a bit of information about where DOS has been loaded like CLS, VER easy to use. Just enter and you will get the message MS-DOS Version 6.2
Revision A
Dos is in HWA

MS DOS Commands have been revised or changed a number of times. Each revision has a version number assigned to it, so with this command current version can be identified.

14> PATH:-

Sets or resets an environment variable that is used to state alternate search directories for files. If path is specified at the DOS, the current contents of PATH are displayed.
E.g. DW5PG.COM is program and it resides in the c:\DW\DW5PG or you can change directories before starting the program.

C:
CD\DW
DW5PG
Set path = C:\DOS;C:\BATCH;C:\BIN
The path variable is begin set in the above example.

15> PROMPT:-

PROMPT $P$G

On execution of this command, the DOS prompt tells you which directory you are in, i.e. current directory. If you are in sub-directory or any level of sub-directories, this command will display the path i.e. drive, backslash root and the names if the sub-directories till its current sub-directory. It is used to change the DOS prompt.

$ Displays $ (dollar sign)
b Displays (vertical bar)
d Displays system date
g Displays > (greater than)
h Back spaces (erase previous character)
l Displays < (less than) n Displays default drive letter p Displays default drive and directory path name q Displays = (equal sign) v Displays DOS version number t Displays the system time Command Results Displayed Prompt A> (disable the current drive)
Prompt command? Command?
Prompt $p$q A:\= , A:\WP=
Prompt $P$G A:\> , A:\WP>
Prompt $p$d$t$g A:\Fri 01-01-1997 11:05:32>
A:\ss\Fri 01-01-1997 11:05:32>
Prompt $l$p$g

Prompt $p : command? A:\123:command?

16> SET:-

It will show, set or reset a DOS variable.

Syntax : SET [Varname = [string]]

Varname - is name of the variable that is to be set or reset

String - is what the variables to be set to
E.g. SET ABC = HELLO
Here ABC is variable and HELLO is the string assigned
The path variable is begin set in the above example.

17> VERIFY :-

When DOS is writing information to disk, it normally accepts the disk drive’s report that all went well. If you wish, you can ask DOS to check, or verify, all data that is written to disk. This is controlled with VERIFY command. Which can set verification on or off.

VERIFY ON – Verification on
VERIFY OFF-Verification off

If you want to find out the current status of VERIFY, then enter the command itself. Being able to turn it on and off, because you may not want to have verification in action all the time.


This concludes internal commands part of MS DOS Commands. Now, we will have a look at external commands.


EXTERNAL COMMANDS

EXTERNAL COMMANDS: External commands are carried out by separate programs, one program for each command. E.g. the FORMAT command is carried out by the FORMAT.COM program. When you install DOS, all of these programs are copied to your hard disk.

1> CHKDSK (Check Disk) :-

DIR command shows us a list of the files on a disk. The CHKDSK command gives us status report of the disk. First, it checks the disk over to see how much free space is available and how much is in use, and to see if there is any discrepancy in the space usage. It then reports the total space in use, the number of files and incidentally, whether there are any hidden files.

To use CHKDSK, enter the command followed by the name of the disk you want to check. For example:

CHKDSK C:

So the CHKDSK gives following report :

VOLUME NORTON CREATED 03-10-1991 8:53P
VOLUME SERIAL NUMBER IS 0868-1BFA

32407552 BYTES TOTAL DISK SPACE
77824 BYTES IN 2 HIDDEN FILES
61440 BYTES IN 25 DIRECTORIES
2238640 BYTES IN 798 USER FILES
9883648 BYTES AVAILABLE ON DISK
2048 BYTES IN EACH ALLOCATION UNIT
15824 TOTAL ALLOCATION UNITS ON DISK
4826 AVAILABLE ALLOCATION UNITA ON DISK
656368 TOTAL BYTES MEMORY
623504 BYTES FREE

On the first line we see the volume label of the disk. It specifies when we format the disk and it can be changed with the LABEL command. Next we see the date and time that the volume was created-that is, when the disk was formatted. The second line shows the volume serial number that was assigned by the FORMAT program.

Next, we see the total amount of space on the disk and a breakdown of how this space is being used.

If the above command is used without specifying the names of the disk default disk will be checked.


2> FORMAT:-

Any disk that is used with a computer requires to be formatted first. This command will divide the floppy into tracks and sectors. The file FORMAT.EXE has to be present for executing this command. A format is a method in which the data can be recorded in a recognizable manner. FORMAT actually does tow important things with a diskette, it draws the electronic “lines” that make it possible for DOS to work with the diskette and it checks for any defects in the diskette. When FORMAT finds bad patches, it reports them to you, indicating their size as well as the size of the usable part of the diskette. Once this is done, the rest of the diskette is ready to use.

E.g. FORMAT A:

When the FORMAT command is issued. The following message is displayed:

Insert new diskette for drive A:
And press ENTER when ready…

You are required to press the ENTER Key to begin the formatting.

FORMAT is one of the most dangerous command in DOS because it can wipe out an one. Be very careful when you format diskettes.

3> TREE:-

The file TREE.COM has to be present for executing this command.
This command displays all the directory paths found on the specified drive. It displays a tree-like structure with branches and files contained in each if required.

E.g. TREE C:\

4> DISKCOPY :-

The following message appears “Insert Source diskette, Press any key to continue”.

Ensure that the diskette from where the contents are to be copied is inserted as the source diskette. To make sure that the source diskette is not overwritten by error, write-protect the floppy-i.e. one can only read this floppy. For a 3.1/2” diskette, it is done by pushing up the black button on the floppy and a square hole is visible.

For a 5.1/4” floppy there is a notch on the left side of the floppy. If the notch is covered with a silver rectangular piece called read/write label the floppy is write protected.

The computer reads form the floppy, stores it in the RAM and asks for the target diskette. Now remove the source diskette and insert the diskette on to which you would like the contents to be written. Make sure your target diskette is not write protected. Report the process of inserting and removing the two diskettes till the DISKCOPY is finished and the following message will be displayed:

Copy another diskette – (Y/N)

If N is entered, DISKCOPY will be ended. If Y is entered, another copy operation will be performed as above.

5> DISKCOMP (Disk compare) :-

When you make copies of files or disks, you may need to confirm that the copy is accurate. The DISKCOMP command lets you compare entire diskettes to see if they match exactly. DISKCOMP is primarily useful as a means of verifying the results of a DISKCOPY, because DISKCOMP will report two diskettes as being different even if they contain the same data and are functionally equivalent but differ in some minor way. Such as the order the data is stored in.

The DISKCOMP command is easy to understand and use. To use it, you enter the command name. Followed by the drive specifications of the two diskettes. Both diskettes are read from front to back and compared: any differences are reported. E.g.

DISKCOMP A: B:

You can use both A: and B: even if you have only one diskette drive. DOS will use your single drive to simulate two drives and will tell you when to switch the diskettes.

As DISKCOMP compares the two diskettes, it tells you the locations of any differences it finds with messages like this:

COMPARE ERROR ON SIDE 0, TRACK 7
COMPARE ERROR ON SIDE 1, TRACK 8

6> BACKUP :-

BACKUP is designed to copy your data from a hard disk to as many diskettes as are needed to hold them. The file BACKUP.EXE has to be present for execution of the command. You can use BACKUP to copy from any type of disk to any other and you can even back up your diskettes into a hard disk.

If you want to copy entire contents of a hard disk (assume drive c) onto diskettes (assume they are placed in drive A), then you use the BACKUP command like this :

BACKUP C:\ A: /S
The parameter C:\ instructs BACKUP to start from the root directory of drive C. The /S switch tells BACKUP to copy all the subdirectories as well as what is in the root directory that is all the files.

If one floppy is full it will keep some kind of continuation mark called control data and will ask for the next floppy and the procedure will continue till all data has been backed up.

7> RESTORE :-

RESTORE reverses the backup operation and has the same sort of features. It will only restore files to exactly the same directories from which they were backed up.

As a general rule. When you save files using BACKUP, you should use the RESTORE from the same version of DOS.

RESTORE A: C:\*.*

You tell DOS what disk holds the backup file and which files want to restore. In this case. We have told DOS to restore all the files from the diskette in drive A.


8> RECOVER :-

There are many ways that your disk data can be lost or damaged and the whole subject of data recovery is an important one. If part of a disk has been damaged so that a file can be partially read or partially not, the RECOVER command will remove the unreadable part so that you can use rest. Depending upon the kind of file it is, the recovered portion may or may not use usable. Generally, this kind of file recovery only works with ASCII text files which contain written material. To use RECOVER in this way, you enter the command followed by the name of the file it is to check for readable and unreadable parts.

The other kind of file recovery done by RECOVER is completely different and confuse with the first one and so danger lies here. Here RECOVER assumes that the entire directory of the disk is damaged and nonessential. It throws away the entire directory and replaces it with a new one.

To use RECOVER in this way, you enter the command without specifying any file name. sut remember that this form of RECOVER wipes out your entire directory. So be careful before you use it. Completely avoid the use of RECOVER command, for safety’s sake.

9> UNDELETE :-

To unerase a file, use the UNDELETE command, followed by the name of the file you want recover. E.g.

UNDELETE MYFILE.DOC

If it is possible to unerase the file. DOS will ask your permission. You should answer yes.

Unreasing is straightforward. Other than specifying the name of a single file. You can specify a collection of files :

UNDELETE *.*
UNDELETE *.BAT

If you specify the name of a directory :

UNDELETE \DOCUMENT
Dos will try to unerase all the deleted files in that directory.
If you use UNDELETE without a file name :

UNDELETE

Dos will try to unerase all the deleted files in the current directory.

If you want to check what files can be unerased without actually committing yourself, use the /LIST option.

10> UNFORMAT :

UNFORMAT will attempt to undo the work of a previous FORMAT command. However, you will lower your chances of successful recovery if you have used the disk to store any new data. So when you find you accidentally formatted a disk, stop whatever you are doing and run UNFORMAT immediately.

With UNFORMAT command you need to specify the name of the disk you want to unformat :

UNFORMAT A:

11> DOSKEY :-

The roll of this command is to let you recall a DOS command, edit it and then re-enter it. DOEKEY command available with DOS 5.0 or later. The line that you are currently typing called the command line. DOS maintains the command line, interpreting each key as you press it. With DOSKEY.DOS also keeps a list of all your previous commands, called the history list.

If you are using DOSKEY.DOS copies commands to the bottom of the history, list. So DOSKEY recalls data from the history list. To recall command you have to use arrow key.

12> ASSIGN :-

ASSIGN instructs DOS to reroute requests for one disk drive to another, essentially “pretending” that drive X is really drive Y. following is the form of assign command :

ASSIGN olddrive =newdrive

You can assign several drives at the same time if you want to. E.g. if you want to assign drives A and B to your hard drive, C the command is :

ASSIGN A=C B=C

To undo the assignment just issue the ASSIGN command with no parameters, so that program references to A and B go where they were originally intended.

ASSIGN

13> ATTRIB :

This command lets the user set, remove or display the attributes of all the file in a specified directory. This command can offer a certain amount of protection to the file.

To turn on an attribute, use a plus sign (+) followed by a single letter R.A, S or H. and specify the file you want to effect. The meanings are as follows :

+R make the file read-only
+A make the file as needing archiving
+S make the file a system file
+H make the file hidden.

E.g. let’s say that you have a very important file, DATA.NEW. and you want to make sure that you do not accidentally change or erase it. You can make the file read-only by using :

ATTRIB +R DATA.NEW

ATTRIB will recognize wildcards. E.g. to turn on the archive attribute for all the files in the \DOCUMENT subdirectory, use :

ATTRIB +A \DOCUMENT\*.*

If you do not specify a file name. ATTRIB will act on all the files in the current directory. E.g. to make all files in the current directory. E.g. to make all files in the current directory read-only, you can use either of the following two commands :

ATTRIB +R
ATTRIB +R *.*

If you want to turn off a particular attribute, just use a minus sign instead of a plus sign. E.g. you decide to delete the file DATA.NEW but you cannot because it is read-only. To turn off the read-only attribute, use :

ATTRIB –R DATA.NEW

You can now delete the file.

14> FIND :-

The FIND filter is used to identify the lines of data that have, or don’t have. Some particular data on them. To use FIND, you must specify what you are looking for, enclosed in double-quotes. FIND filters out the lines that don’t contain what you are looking for, and only passes on the lines that do. For example :

TEST I FIND “ERROR”

As you might expect, FIND has some switches: the /V switch reverses the search so that lines with the specified information are filtered out and the others are passed through. The /N switch adds in the relative lines numbers ( Which can help you know where the data was found). The /C switch gives a count of the lines found, without passing any other data on.

Following is the example of /V. Here you want to find a file that contains the letters FIL, somewhere in the file name. FIND command with combination of CHDSK is useful for a complete list of files.

CHDSK /V I FIND “FIL”

Here is some sample output :

D:\DOSBOOK\GENERAL\MYFILE.DOC
D:\UNX\INFO\GENERAL\FILENAME
D:\MIRORSAV.FILNAME
D:\MIRROR.FIL

Following is the example of /N.
TYPE ABC I FIND “AB”/N

Here ABC is the filename. TYPE command use to display the contains. FIND with parameter /N use to display then line number where the data was found. So following is the output :

[1] AB ABCD AB ABCD

here data was found at line number one.

15> LABEL :-

If you have a formatted disk which does not have a volume label. You can’t use the FORMAT command to give it a volume label, because formatting would destroy your data. In this case LABEL command. Including drive specification if necessary can be use:

LABEL A :
And LABEL’S response looks like this:

VOLUME IN DRIVE A HAS NO LABEL
VOLUME SERIAL NUMBER IS 1848-1021
VOLUME LABEL [1] CHARACTERS, ENTER FOR NONE)?

If you want to change the existing volume label called REPORT to ACCOUNT, place the diskette in drive A and enter :

LABEL A:

The command responds :

VOLUME IN DRIVE A IS REPORT
VOLUME SERIAL NUMBER IS 0B60-14ED
VOLUME LABEL (11 CHARACTERS. ENTER FOR NONES)?

You can now type the name ACCOUNT and press . The diskette now has a new volume label. You can check it :

VOL A:

You will see :

VOLUME IN DRIVE A IS ACCOUNT
VOLUME SERIAL NUMBER IS 0B60-14ED

You can also remove a disk’s volume label, replacing it with nothing, again type LABEL A: and see the same display as before. This time press only and the command responds :

DELETE CURRENT VOLUME label is removed.

If you press Y, the volume label is removed.

16> MEM :-

MEM will tell you about the memory in your computer.

MEM

It shows summary that looks like this :

656384 BYTES TOTAL CONVENTIONAL MEMORY
655360 BYTES AVAILABELE TO IBM DOS
623712 LARGEST EXECUTABLE PROGRAM SIZE

7602176 BYTES TOTAL CONTIGUOUS EXTENDED MEMORY
0 BYTES AVAILABEL CONTIGUOUS EXTENDED MEMORY
5225472 BYTES AVAILABELE XMS MEMORY
IBM DOS RESIDENT IN HIGH MEMORY AREA

In this example computer has 8 megabytes, about 8.4 million bytes.

17> MODE :-

MODE allows the user to configure the system devices. It is a complex command with seven options. You can use MODE to :

* Set the characteristics of a parallel printer port.
* Set the characteristics of a serial port.
* Display the current status of various hardware devices.
* Redirect parallel printer output to a serial devices.
* Control code page support (for non-English languages).
* Configure the display , including the number of lines.
* Set the automatic repeat rate for the keyboard.

MODE BW80

a) BW means black and white.
b) 80 stands for 80 characters to be displayed on the screen.

18> MORE :-
When you have information displayed on the screen, there is often more than can fit onto the screen at one time, and some of it may roll off the top of the screen before you get a chance to study it. The MORE filter is designed to display only as many lines of information as will fit onto your computer’s screen, and the press enter to indicate that you are ready to see more. MORE is only used at the end of a pipeline.

To display a long directory listing one screenful at a time, you could enter :

The most common use of the MORE filter is to process the output of a TYPE command that is displaying a long file :

TYPE LONGFILE I MORE

This keeps the output form scrolling off your screen faster than you can read.

19> PRINT :-

PRINT command prints a text file while you are using other MS-DOS commands. This command can only be used to print textfiles. Other files cannot be printed with this command. The PRINT command loads itself into memory, and stays there until the computer is turned off or reset. From then on. Any time you invoke the PRINT command, you just tell it what you want it to do.

To get printed information give the name of the file followed by the PRINT command.

PRINT MYFILE.DOC
If you want, you can specify the name of more than one file. DOS will print them in the order you .specify. E.g.

PRINT MYFILE.DOC YOURFILE.DOC’
PRINT *.DOC
20> SORT :-

It is much easier to locate anything if it is put in order. This task is handle by the SORT command. It cannot be executed with no parameters at all. There has to be some input given to the program. In other words, SORT requires to have something to sort. SORT like other DOS commands, does not differentiate between upper and lower case. So A and a are exactly the same. SORT treats each line of data as a separate entity, and so it is the order of the lines of data that SORT rearranges. Normally SORT arranges the lines in first to last order. But a switch /R. will make the sort work in reverse order.

SORT <>

The file ABC.TXT is sorted line-by-line and the output is sent to the standard output devices. The output could be directed to a printer or another file if required.
A common example of the use of SORT, is with the DIR directory command.

DIR SORT

This command will sort the files into order by name.

By using the/+n switch to shift to shift the sorting over to the column where the file size is displayed, you can get the list in order by size :

DIR SORT /+14

21> XCOPY :-

This command used to copy multiple files and directories in one go. A number of files are read at once and copied to the destination. It is more powerful than COPY command.

XCOPY, like COPY also does warn if a file already exists before a copy is made. XCOPY will copy groups of files including a whole tree structure of files. XCOPY , the source of copying can be all the files in a directory tree and XCOPY will duplicate that directory tree on the target disk.

The basic form for XCOPY is this :

XCOPY source target

The source and target specifications can be either file specifications or directory path specifications. All the various rules for the copy command like wildcard file names. Target names different than source names, etc. can be use with this command.

THE MAIN STANDARD USES OF FILE NAME EXTENSIONS :-

$$$ Temporary work file.
ASM Assembly source.
BAK Text file back-up copy.
BAS Basic source code.
BAT Batch processing file.
COB COBOL source file.
COM Executable programs, in memory-image format.
DAT Data files, in general.
DBF Used by DBASE.
DOC Word-processing document.
EXE Executable programs, in relocation format.
FMT Used by Dbase.
FOR FORTRAN source code.
LBL Used by Dbase.
LIB Library routines, for compilers.
LST Printable listing files, in general.
NDX Used by Dbase.
OBJ Program object code, from compilers.
PAS Pascal source file.
TXT Text files. For word processors.
WK1 Lotus worksheet for 1-2-3, version 2
WKS Lotus worksheet for 1-2-3, version 2
WRK Lotus worksheet for Symphony.


WORDSTAR 4.0

Wordstar 4.0 is a software package that enables you to perform both simple and complex word-processing tasks.

“Word processing”, in computer terminology, refers to the typing, ending and formatting of any kind of document, which could be a letter, a memorandum, a balance sheet or something similar. As the term suggests, a word processor simply processes words, that is, textual information. You can use it to print letters, reports, booklets, and so forth, in a layout you desire. This the word processor does by simply formatting the information you or somebody else has keyed into the computer. (keying information into a computer is a process similar to typing.)

Word processing is different from conventional typing in many ways. Here the document is not printed while being keyed-in, However, its image is displayed on the computer screen (similar to a TV screen), and the information you enter is also stored in the computer memory. The computer operator memory.