![]() |
|
Batch tutorial for noobs Vol. 1 (we all start somewhere) - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Coding (https://sinister.li/Forum-Coding) +--- Forum: Coding (https://sinister.li/Forum-Coding--71) +--- Thread: Batch tutorial for noobs Vol. 1 (we all start somewhere) (/Thread-Batch-tutorial-for-noobs-Vol-1-we-all-start-somewhere) |
Batch tutorial for noobs Vol. 1 (we all start somewhere) - Inori - 12-27-2013 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! 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! |