Jump to content

[TUTORIAL] Batch Basic Tutorial/Reference


Recommended Posts

 

Batch, although many people think is "nooby and useless" has many, MANY uses, for windows of course.

 

Lets start off with some basic commands.

 

@echo off : This command is not essential, it only makes the appearance of your batch program look neater, by turning off all the pretext that is inside of batch programs.

 

pause : This sets a pause in the program, prompting the user to press any key to continue.

 

cls : cls clears all the text on the screen.

 

exit : This, obviously, exits the program.

 

echo : this "echos" the text you put after the command. For example: "echo Hello World!" prints Hello World! on the screen.

 

color : This sets the color of the text. The colors are defined below:

 

0 = Black      8 = Gray

1 = Blue        9 = Light Blue

2 = Green      A = Light Green

3 = Aqua        B = Light Aqua

4 = Red        C = Light Red

5 = Purple      D = Light Purple

6 = Yellow      E = Light Yellow

7 = White      F = Bright White

 

" " : Quotation marks open the process set inside the quotation marks. For example:

"www.google.com" Will open Google.com.

 

Finally, at the end of coding a program, click file > save as > any_name.bat.

 

Now lets smash up all of these commands into one program.

 

@echo off

color a

echo This is my first program!

pause

cls

echo I hope you enjoy it!

pause

cls

echo Now here is a great forum you should try out!

pause

cls

"www.maxcheaters.com"

pause

cls

echo Thats it for now!

pause

exit

 

I hope you enjoyed the tutorial!

 

Let me know if you want another Batch tutorial.

 

 

Regards:

 

High Roller

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...