Your first program with Batch


Today you are going to learn your first program - obviously "Hello World"!


Here are the steps:


1. Open up notepad (find it in start and accessories).

2. type in (with appropriate case) the following:

 3. Save as a .bat file (as shown below).

 4. You're done!


 This is the finished product:

 Now you may not get what's going on, but what's happening is when you open the file next time,

it's going to print "Hello world" on something that looks really old school, called the console. Then

it should say "Press any key to continue.." and when a key is pressed, it should close itself. Now

let me explain to you what each command does.


When you type "@echo off", it stops additional text to appear, such as "C:/Users/[your name]/

Desktop/", which tells where the file is located.


When you type "color 0f" it tells the console (in a color code) the text and background color.


When you type "title Hello World", it makes the top bar of the window "Hello World".


When you type "echo.", it tells the console to make an empty line.


When you type "echo Hello world!", it tells the console to print the text "Hello world!".


When you type "pause", it shows the message "Press any key to continue.." and waits for you to

click a key.


When you type "exit", it - well exits!

This free website was made using Yola.

No HTML skills required. Build your website in minutes.

Go to www.yola.com and sign up today!

Make a free website with Yola