MS-DOS and Windows command line type command
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.
- 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
The type command has no options.
Filename is the name of the file to show.
Display the file's contents C:\autoexec.bat, if it exists.
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.