Microsoft DOS type command

Updated: 05/22/2018 by Computer Hope

About type

Display the contents of a text file.

The type command does not allow you to edit the file, or add new text. To edit a text a file, use Notepad instead. Or, to append text to a new or existing file from the command prompt, you can use copy con.

Availability

The type command is an internal command that is available in the command line of all Microsoft operating systems.

Syntax

type [Drive:][Path]FileName

The type command has no options.

FileName is the name of the file to show.

If no Path is specified, the file must exist in the current directory. If no Drive is specified, the file must exist on the current disk drive.

Type examples

type c:\autoexec.bat

Display the contents of the file C:\autoexec.bat, if it exists.

type myfile.txt

Display the contents of myfile.txt, if it exists in the current directory.

type "My file.txt"

In this command, the file name contains a space, so it is enclosed in double-quotes.

type "C:\Users\Jeff\Desktop\My files\My notes.txt" | more

Display the contents of the file C:\Users\Jeff\Desktop\My files\My notes.txt. Here, the type command is piped ( | ) to the more command that pauses the display after each screen of output, making it easier to view long files.

Additional information

  • See our type definition for general information about text and typing.