Simple batch Programming
Simple batch Programming
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 /?')

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

Simple batch Programming
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

Step 2: Batch program 1 Matrix program

Simple batch Programming
Simple batch Programming
I have enlarged the image so you may be able to see it. if you have seen 'The Matrix' you will see lots of different green numbers appear.

The ':start' is a label so the 'goto start' will go back to that label and replay whats after it in this case in a loop never ending (unless you close it)

The echo command will project what is after is on the same line but in the notepad style is says %random% that is the random number so in batch programming that is a random number.

As you can see the colour is a black back ground and green writing.

In the second picture you can see how to save a batch program

1. once you have done the coding press save as...
2. name what you want to call it in this case Matrix Program (my one says different) but once you have named it you MUST put .bat at the last word of the title so it would be Matrix Program.bat
3. You MUST select save as type to all files like in the picture then you can press save.

Step 3: Batch program 2 deleting..

Simple batch Programming
in this one its just like the matrix program apart from in stead of:
echo %random% etc.
this time it will be:
echo Deleting... %userprofile%\documents\%random%
echo Deleting... %userprofile%\documents\%random%\%random%

The %userprofile% is it will come up as c:\(name of your comuter)\
and this time the color is black background and red writing.

Its the same to save it just like the matrix program but you might save this as:

Step 4: The last batch program Story writing.

Simple batch Programming
This one is more advanced than the others so try stay on track.

the same with the start as the matrix program but the 'SET /p userin1' is the command were you can type.
the userin is like a random or userprofile (This is a variable) when you want it echoed put echo %userin1% you still with me?
then the pause>null is a pause you can put pause but it will say 'press any key to continue...' with this one it will go blank and once you press any key it will end.

Step 5: DONE!

now you are done with the 3 batch programs comment if you like or not and if you found it complicated or if you found it easy.

Also post if you have learned the commands and sent me some of your own batch programs.

THANKS for viewing Io kieran oI out :)


Tag cloud

make build easy simple arduino making homemade solar laser printed portable cheap mini building custom cardboard wooden create super lego turn paracord chocolate your paper light intel