Statua
Would you like to react to this message? Create an account in a few clicks or log in to continue.


Welcome To Statua. Feel free to message any of our staff.
 
HomeLatest imagesSearchRegisterLog in

 

 Basic Batch Tutorial

Go down 
AuthorMessage
alex
Admin
Admin
alex


Posts : 28
Points : 10048
Rep : 2
Join date : 2010-06-18
Age : 30
Location : uk

Basic Batch Tutorial Empty
PostSubject: Basic Batch Tutorial   Basic Batch Tutorial Icon_minitimeSat Jul 03, 2010 1:52 pm

Basic Batch Tutorial

What is Batch?
For those who don't know, a Batch file is a text file containing a series of commands to be executed by Command Prompt (CMD). When a batch file is run, CMD reads the file and executes its commands. To open your CMD, click START RUN type "CMD" OK (some of you may need to type "CMD.EXE") (or you can click START ALL PROGRAMS ACCESSORIES COMMAND PROMPT).

Now What?
These are some VERY basic commands you need to know: (please try out some of these commands in your CMD). @echo off - This gets rid of that "c:\documents...etc" echo - This displays a message, (e.g "echo hello" = "hello") because if you type "hello" into CMD it will interpret "hello" as the command cls - Clears the CMD of all text.

What if you want to run lots of commands?
That is where BATCH comes in. Try copying this into your notepad (NOT Microsoft Word) and save as BatchFile.bat Notepad is in accessories NB: You must save it as .BAT or it won't work. P.S (copy BETWEEN the stars, don't include them) *********************************************************** echo If you type echo before a sentence it displays it as a message.

The GOTO command
Now we will learn how to use the GOTO command. The GOTO command jumps to a certain part of your text. Example: if you type "goto fish" then it will goto the place that you have typed in ":fish" NB: you must always have a colon (Smile, before a word that is going to be GOTO'ed Example: you know the drill, copy into notepad and save as a .bat file.

The START command
The START command starts something. Not much to explain here. For example: open your CMD and type: "start www.instructables.com" This opens your default explorer and goes to the Instructables site. OR "start itunes" OR You can also open files or folders: "start desktop\foldername.

Thanks for reading hoped it helped Smile cheers
Back to top Go down
http://statua.co.cc
 
Basic Batch Tutorial
Back to top 
Page 1 of 1
 Similar topics
-
» Basic Command Prompt Commands
» Error & Classic SQL Injection Tutorial

Permissions in this forum:You cannot reply to topics in this forum
Statua :: Coding :: Batch (.bat)-
Jump to: