I'll first show you the complete batch file and then explain what each line does.
- Code:
-
@echo off
rem Start of your Batch File
echo Hello World!
echo.
echo My First Tutorial
@pause
simply copy and paste in notepad then
save it as .bat eg. (EchoTest.bat)
The first line (
@echo off) is required to tell DOS not to display the succeeding lines on the monitor screen, and the "@" symbol tells DOS not to show the line itself.
"REM" which is short for "Remark". DOS does not execute these lines.
ECHO [message]
Display your message
eg.
echo Hello World
result in this..
Hello World
echo. insert next line.
eg.
echo Hello World!
echo.
echo Hello World!
will result to this..
Hello World
Hello World
and
@pause simply pause your batch file. and displays the message Press any key to continue . . .