Welcome to the "First Batch Script" tutorial.
First off Open note pad. You will need this to make batch files.
1.Getting started:
Ok well to start of you can only have one command per line. so it would look something like;
<example>
@echo off
Echo Hello world
pause
exit
<example end>
Next you will need to know what does what. look at this list to get reference for this tutoral:
[Dear Visitor, you're restricted from viewing links until you are registered & logged on.
Click Here To Register Today
2. Writing your first code:
Ok In notepad place this code below in it and save it to location. Name the file
"helloworld.bat"(without quotations). When writing a batch file you must always add the file extention ".bat" at the end of it.
Code:@echo off Title Hello world This is the title Echo Hello world! pause exit
After makeing saving it, open it and see what it looks like.
3. Explaining the hello world display code above:
Ok, @echo off means that all commands are hidden. Title means set the title of the script to have the name which you have placed beside it. Echo means relay/display the text which is beside is on the CMD display window. Pause means that the script will wait till the user wants to continus to the next command line. Exit tells the window to close or end.
4. Playing with the code:
After understanding how it works we are going to add color, your name, and another echo line.
Now at this point you should have somewhat of a simple understaning of the batch file and scripting. so now we are about to add color to your bach file.
Place color below the command hide. save it. Next open your file and see what it looks like. Play with the number and see what you get.Code:@echo off Color 02 Title Hello world This is the title Echo Hello world! pause exit
Ater this we are going to change the title to "Hello {your name here}! This is the title!". Now add the text display command to say ANYTHING you want. then save. and open it.
GRATSSSSSSSS!!!!!!!!!!!!!! you have now offically learned how to color a batch file, add a title, how to creat a text dislay/comment and pause for user prompt to continue. Stay on a look out for more batch guides I will write! Thanks!
#Recovery Mode
LinkBack URL
About LinkBacks
Reply With Quote
(btw its saving not saveing)


Nice guide 

programfiles\ drag and drop.


Bookmarks