How to Display Text with a BAT File

A batch file is a text file that includes the lines of Microsoft DOS commands. DOS batch files have the .bat file name extension. Batch files are useful to automatically execute programs in a sequence and to automate the computer tasks that require multiple or repetitive steps. You can use the ECHO command in a batch file to see text messages on the computer screen. By displaying text messages included with the .bat file, you can monitor its execution.

Video of the Day

Step

Click "Start" in Windows, and then click "Run." Type in "cmd" and then click "OK" to open a command line window.

Step

Type in "edit" and press "Enter."

Step

Enter the following commands in the open window:

echo off

echo %date%, %time% >> log.txt

echo Current date/time is %date%, %time%.

@pause

exit

Step

Click "File" and then "Save." Enter "my_batch.bat" and click "OK." Click "File" and then "Exit."

Step

Type in "my_batch.bat" and press "Enter" to display the current date and time on the computer screen.