Very Basic Batch Tutorial by Sejma
cmdbatchpic.bmp
If you already know the essentials of Batch the you DO NOT need to read this instructable continue to Not So Basic Batch Tutorial.

NOTE!: Whenever something is in quotation marks ("example"), do not include the quotation marks (if you see that you must just type: example)
 
Remove these adsRemove these ads by Signing Up

Step 1: So, 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).
admin says: Jun 17, 2008. 12:19 PM
Hello, and welcome to the Instructables community! It's great that you've decided to tell the world about something you've made by publishing an Instructable. We just wanted to let you know that your project still needs a little more work if you want it to be well received on Instructables. Projects that don't include certain basic elements tend not to get the attention that they deserve, and so we'd love for you to check out the list below of what makes a successful Instructable. Successful projects on Instructables include: - clearly written details of a finished project with instruction - as many steps as are necessary to explain your project - clear images that you took of your project for most, if not all of your steps - an intro image - proper spelling and grammar - appropriate cautions or safety considerations I'll give you another opportunity to make any final changes to your project before we publish it. Once you're all set to go, please republish your project and send me a quick comment letting me know that you've made some changes. I'll give it a quick final check to make sure you're on the right path, and then remove this note. Thanks for your submission and we hope to see your project published soon!
tabascow says: Nov 27, 2011. 8:29 AM
@ echo off
echo :press a key to go to ???
pause
start www.instructables.com
will421 says: Jul 22, 2010. 6:49 AM
I learn my first batch stuff here and and looky me! I understand every command from TAT`s batch... file... mega... subsystem I think? Or is it just system? OH WELL!
sinxxx says: Jun 12, 2010. 6:31 AM
ee
Mr. Qwack says: Jan 6, 2009. 3:44 PM
u dont need the @ in front of the echo if u type in echo off or echo on
Guard13007 says: Apr 10, 2010. 9:18 PM
 You do if you want a clean file. What I mean is that the command turning echo off will show up at the top. You don't want one code to show up and then have it be all clean, you either put the @ and make it all clean or forget that command and deal with the extra stuff.
redmaker says: May 24, 2009. 10:11 AM
coooooool i put color 4d
will421 says: Jun 21, 2009. 3:32 PM
You like pink when your username is redmaker!??!?!??!?!??!??!
will421 says: Jun 21, 2009. 3:33 PM
Okay that is kinda cool....
Doubleblades85 says: Mar 24, 2010. 4:43 PM
haha
redmaker says: Jun 26, 2009. 7:03 PM
no i hate pink but i didnt knolw wat to put so i radomly pressed 2 keys
bmlbytes says: May 13, 2009. 6:38 PM
Ahh! The evil GOTO command!!!!!!!!!!!!!!!!!!!!! Make it go away! Try using this in school for a real programming language. The professor will tell you to just leave and never come back. GOTO is evil in all cases.
knex_mepalm says: Feb 13, 2010. 1:20 AM
 It doesn't seem to work for m, I made a batch subsystem which is incomplete and it does not seem to work wah...

kroq-gar78 says: Aug 13, 2009. 6:43 PM
FORK BOMB FTW!!!!
Doubleblades85 says: Mar 24, 2010. 4:42 PM
Indeed
tinkerC says: Jul 12, 2009. 8:15 AM
Then your professor should not be teaching programming. The goto command must not be over-used, but it stops your programs from being linear. That is very useful, as your professor doesn't realize.
Sejma (author) says: May 15, 2009. 5:00 AM
HAHAHAHA!!! so true friend, im busy studying java atm and whenever the topic of the GOTO command is brought up, our proffesser pretends he's deaf :D
ForgetMyDiySorry says: Jun 10, 2009. 9:08 AM
Haha, yes indeed. I had ICT class last week(to orientate for next year's electives)
and i wrote a simple program including multiple choice questions and a simple clock ( commands: echo %TIME% %DATE%) and the teacher was like: uhm, if you're gonna use GOTO in my class you can just leave and i'll give you an A because, it IS pretty advanced but still it's not good. haha GOTO = evil!
tinkerC says: Jul 12, 2009. 8:17 AM
I'm sorry, but if the commands clear the line, type in the time, and wait half a second each time, use the goto command, as it is the way to do it. Loops take too much time.
erikals says: Jul 16, 2009. 2:42 AM
(removed by author or community request)
erikals says: Jul 16, 2009. 2:44 AM
EDIT: I found the file, downloaded it, and it works.
comno says: Jun 1, 2009. 10:34 AM
Can you do this with programs or documents
comno says: Jun 1, 2009. 10:28 AM
Thank you much
Beverly5876 says: May 4, 2009. 6:55 PM
Batch is a new language for me. I'm still not sure what all it is or how far I'll get with it but, I do love a challenge and learning something new. In fact...I always did want to learn a new language. LOL Thanks.
Eirinn says: Jan 12, 2009. 12:23 PM
Thank you, just what i needed for some basic shortcut stuff!
HardCoreHacker says: Jul 9, 2008. 1:39 PM
Great!!
Sejma (author) says: Jul 10, 2008. 1:18 AM
ty man
altondoug says: Jun 19, 2008. 5:29 PM
I've been programming for a few years and I think its very informative for the newbies . Most of us won't take the time to explain the little stuff that we take for granted knowing..
Sejma (author) says: Jun 20, 2008. 9:02 AM
NMice to hear some positive feedback, thanks :)
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!