Windows Batch Scripting/File Commands

=3. File Commands=

This chapter covers the following commands:


 * COMP -   Compares the contents of two files or sets of files.
 * FC -     Compares two files or sets of files, and displays the differences between them.
 * FIND -   Searches for a text string in a file or files.
 * FINDSTR - Searches for strings in files.
 * MORE -   Displays output one screen at a time.
 * PRINT -  Prints a text file.
 * SORT -   Sorts input.
 * TYPE -   Displays the contents of a text file.

The TYPE Command
The TYPE command display the contents of a file. There are no options for the TYPE command.

The SORT Command
The SORT command will sort lines of text from a file.

The /R option will sort in reverse order.

The MORE Command
The MORE command will display output or contents of file a screenful at a time. It is especially useful when piping it with certain commands (such as DIR or TASKLIST) that produce very long output.

For example: