The type command displays the contents of a text file. However, it 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
Type is an internal command that is available in the command line of all Microsoft operating systems.
Availability
Type syntax
Type examples
All Versions of MS-DOS
Windows 95
Windows 98
Windows ME
Windows NT
Windows 2000
Windows XP
Windows Vista
Windows 7
Windows 8
Windows 10
Windows 11
Type 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 file’s contents 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 file’s contents 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.
Related information
- See our type definition for general information about text and typing.