Wednesday, June 4, 2014

Batch Lessons part 1

Today I am going to teach you how to code a little Batch.  Batch files are saved with the .bat extension.  Today I am going to teach you how to make it write stuff and other basics.  The first thing you should do in a Batch file is write @echo off.  You do not have to do this but the file will look much better if you do.  On the next line type @echo what you want to say goes here.  Then on the next line write pause.


@echo off
@echo Hi
pause


@echo off makes it hide what the program says it is doing.  @echo will make it say something.  pause makes you have to press any key to continue.  Exit will make the program exit.
CLS will clear the page so you could write a code like this.


@echo off
@echo Hi.
pause
CLS
@echo What is your name?
pause
CLS
@echo I am Tate.
pause
CLS
exit


It would look like this.


No comments:

Post a Comment