• 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
  What program(s) do you use?‏ Mark 16 47,409 31-01-2014, 12:03 PM
Last Post: ajeesh
  My first ever program. Lewis_ 5 17,176 16-11-2011, 04:02 AM
Last Post: latch
  (Batch) Useful batch commands Mark 10 31,710 13-02-2011, 02:42 PM
Last Post: Mark
  Everyone in the world will die if I use the stack. latch 5 14,800 01-02-2011, 10:05 PM
Last Post: latch
  Hello World - Your first Python program Mark 0 5,450 13-07-2010, 06:34 AM
Last Post: Mark

Forum Jump: