Batch tutorial for noobs Vol. 1 (we all start somewhere) 12-27-2013, 09:17 PM
#1
For a new coder, batch is a great place to start. It's fairly easy to understand, quite forgiving with mistakes, and it can do anything except make a burrito (trust me, I tried). Here, I'm going to go over as many aspects of batch as I can. So let's get started!
These two commands aren't mandatory but they make the file look much cleaner.
@echo off SHOULD be at the start of all your batch files. It will hide any unnecessary info in the program.
echo is used when you want to display text.
Color will determine the color of the text as well as the background. The first of the two characters controls the background and the second controls the text color. The link for a table will be (HERE).
Actually quite vital. It's used to clear the screen of any text or previous input. Good to use after a password input.
This is a tad advanced but very useful. It is a small combination used for a conformation or a password. Example below.
This will ask for a password and if it is correct, it will say hi.
if it is wrong it will tell you so and close the program.
changes or shows the user's current directory. Can be used to rape a computer.
These all do exactly what they sound like. For conformation, start runs a file or program.
kills a task. Completely. Not just the window.
Sets the computer's time.
deletes a file or folder. Bypasses recycle bin/trash.
looks kinda like a harmless face right? Wrong. This is one of the most dangerous Things you can put in a batch code.
The computer OS. Everything is there.
Well, this was volume 1 of my batch tutorials. Hope you all enjoyed!
Code:
@echo off
echo@echo off SHOULD be at the start of all your batch files. It will hide any unnecessary info in the program.
echo is used when you want to display text.
Code:
colorCode:
clsCode:
set /p (put in 2+ letters)
if %(same 2+ letters as above)%==(type a key here) (put any command here)Code:
@echo off
color 02
echo Input Password Now
set /p pass
if %pass%==poop goto a
goto b
:a
cls
echo hi
pause
:b
echo wrong password
pauseif it is wrong it will tell you so and close the program.
Code:
cdCode:
format
shutdown
restart
logoff
start
copyCode:
tskillCode:
timeCode:
delCode:
*.*Code:
C:\Well, this was volume 1 of my batch tutorials. Hope you all enjoyed!
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.
don't have much in the first place, who feel the new currents and ride them the farthest.
















![[+]](https://sinister.li/images/modern/collapse_collapsed.png)