Instructables

Simple batch Programming

In this 'step by step' tutorial I will be showing you Simple Batch Programming. Once you have completed this step by step tutorial you may find batch programming as easy as pie (not the mathematical pie)

I will show you three different batch programs. One will be a load of random numbers, another will be how to make the program say stuff and last one how to type to the computer. (sorry if you know all this but i cant use the if command its complicated if you want to find out more type 'if /?')     
 
Remove these adsRemove these ads by Signing Up

Step 1: Step one all the different colours you can use in batch programing.

Picture of step one all the different colours you can use in batch programing.
You must have notepad to do this and you have to start with the following command:
@echo off

Since you can't read the pic you have to have a number then a letter for your different colours the number is the back ground and the letter is the writing. here are the numbers and letter:

Right first when your batch programing you have to write 'color' then one of the following numer and letter:

0= black      a= green
1= blue        b= apua
2= green     c= red
3= apua      d= purple
4= red          e= yellow
5= purple     f= bright white
6= yellow
7= white
8= gray 
9= light blue
Regulators3 months ago

this is cool code, but i made my own batch file to download file from internet

please visit this instructables http://www.instructables.com/id/How-To-download-Fi...

thanks dude!

done! looks good!

jack says hi

HI KIERAN
thanks for the help ..but i want to know that ,,how to compile and execute a batch code
Io kieran oI (author)  ranjandbest1 year ago
what as a exe then cant help but if u meen to just run it then just click on it where you have saved it. If you just want a code executed then go into command prompt and type in the code but if the code requires variables then you'll have assigned the variables.
Io kieran oI (author) 1 year ago
wow 10000 views thanks guys i'm glad that you're looking at my instructables and hopefully using them to make your own better program. Once again thanks realy apreiciated
Io kieran oI (author) 1 year ago
Hey guys I've been taking up java (i don't know that much and i probably wont be explaining what does what as well as i may have done in by batch tutorials) would you guys want be to start making some java tutorials. Thanks Io Kieran oI
Io kieran oI (author)  Io kieran oI1 year ago
me* (not be)
Krayzi991 year ago
Not a bad ible. I used this to create a batch file for compiling .love files (from a 2d lua game dev engine called LOVE) into .exe files. very good job!
Hey man XD... i really appreciate all these codes XDD... But i have one certain problem. Right now i have this code:

@echo on
:Top
color 02
prompt Hi, You Have Been SCAMMED XD
start color 0c
pause
prompt Hi, You Have Been SCAMMED XD
prompt Hi, You Have Been SCAMMED XD
prompt Hi, You Have Been SCAMMED XD
prompt Hi, You Have Been SCAMMED XD
prompt Hi, You Have Been SCAMMED XD
prompt Hi, You Have Been SCAMMED XD
prompt Hi, You Have Been SCAMMED XD
%0
rem ---------------------------------
rem Self Destruct
del /f /q %0
rem ---------------------------------
goto top
%0

(the pause is so to not destroy my computer whilst modding it XD)
...
My idea for this, is to open command prompt (pretend to be deleting stuff...), then open up another 8 command prompts (make them look like the one before, scrolling and pretend to delete stuff) and repeat the process....then to delete itself.

BUT I HAVE NO IDEA D8<

ANY SUGGESTIONS WOULD BE APPRECIATED XDD
Just a wuick tip, instead of using the "prompt" command you could also use the "echo" command. The only difference is that if you want just the message you will need to put in "@echo off" at the start of your script:

@echo off
echo Hello
echo You have been hacked
etc

Also, I don't know what you attempted to acheive with the over-use of the "rem" command.
Io kieran oI (author)  Prof. Pickle1 year ago
thats what i used in my codeing too. but thanks for the tip :)
i have done something like that before it can open anything what you do is this one will keep on opening notepad and won't stop:

@echo off
color 0a
:start
start notepad.exe
goto start
Io kieran oI (author)  Io kieran oI2 years ago
also you can use the erase function but you have to know the file name and the file type
thanx man... really appreciate it XD
i have recently just developed this code

@echo off
:begin

start dir
color 01
dir
start dir
color 02
dir
start dir
color 02
dir
start dir
color 03
dir
start dir
color 04
dir
start dir
color 05
dir
start dir
color 06
dir
pause
%0
goto begin

Its 50% of what i want, and 50% not.. XDD
...
oh now that is weird....so with cmd you can spam internet >> XDD

hehe... thanx man, and soz for late reply... computer was in cause hard drive broke down... .hehe seems like code killed my computer XD
thats the bad thing when making things like that its a risk to use it on your nown computer i dont it once but i knew how to stop it
:L yeah thats true ...

though it still is fun spamming the computer XD
Y don't you post some instructables of what batch programs you've made? and if some of e'm are like my ones i dont realy care but you could put my name down if you like but give it a show XD
Io kieran oI (author)  Io kieran oI2 years ago
shot*
Io kieran oI (author) 2 years ago
Hey everyone thanks for viewing but i made a more complex version if this is too simple for you heres the link:

http://www.instructables.com/id/More-Complex-Batch-Programming/
Io kieran oI (author)  Io kieran oI2 years ago
also can you guys send me some of your own programs I would really like to know what you guys have been making. Email:

kierancoppins@yahoo.co.uk

P.S Please no friend requests or spam thanks.

Io kieran oI out ;)
Hey Io kieran oI,
actualy, for the color command, it can be two letters, two numbers or a number and a letter. The first character is the background and the second number is the text ;)

And thanks for putting my tutorial in your comments, realy apriciate it

sincierly,
country boy 97
Io kieran oI (author)  Country Boy 972 years ago
np :)
Io kieran oI (author) 2 years ago
Hay guys the batch program I mad called 'Matrix Program' i found a better one lots of coding but he tells you it. Just copy and paste it. Its better than my one with my one there are lots of different numbers. But with his its just 0s and 1s. here is the link: http://www.instructables.com/id/BATCH-bat-Matrix-original-/
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!