• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
(Batch) Hello world - Your first Batch program
#1
How to make a Hello World script in batch.


STEP ONE:

Open up notepad, if you dont know where notepad is you can open it via run (Win+R) and typing notepad.exe


[Image: 2he9erm.jpg]


STEP TWO:

The first thing we type is " @echo off " this simply hides the current directory location of where the file is being run from.

The next thing we type is the writing that you'll see, this can be anything but for this we are using " Hello World ", so you'll type " @echo Hello World ".

[Image: kebsp2.jpg]


STEP THREE:

You may have noticed a problem when you open the file, a black box appears but then closes straight away. This can be fixed by typing " pause " at the end of the file.

[Image: 2nvz5n4.jpg]


STEP FOUR:

When opened, our finished file should look the same as below.

[Image: zlat10.jpg]


STEP FIVE:

- Saving the file

Go to File > Save As...

File name: anything.bat
Save as type: All Files
Encoding: ANSI

I hope this has helped.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  (Batch) Useful batch commands Mark 10 28,621 13-02-2011, 02:42 PM
Last Post: Mark
  Hello World - Your first Python program Mark 0 5,054 13-07-2010, 06:34 AM
Last Post: Mark
  How to make a menu in batch (And start processes) Mark 3 9,771 13-07-2010, 02:34 AM
Last Post: Jamez247
  (Batch) How to shutdown a computer using a batch file Mark 0 6,403 22-05-2010, 10:49 PM
Last Post: Mark
  (Batch) Autostarting programs on login Mark 0 5,011 22-05-2010, 10:44 PM
Last Post: Mark

Forum Jump: