CoderNet
Hello everyone! This is Grayson. I'm making this site to TEACH YOU ALL TO PROGRAM!! There will ALWAYS be a version number at the bottom :D. So check often and I will give 2 to 3 hints a week on how to program a BAT file. Please put a comment down below on what you think about the site! Also please check out John's blog! There -->@John Dill
TIP #1: use the "echo" command to say something in the BAT file
TIP #2: use the "pause" command to freeze it until you press any key
TIP #3: use "cls" to clear the screen
TIP #4: use "color 0c" to get red letters on a black background
TIP #5: ALWAYS PUT "@echo off" at the beginning of the code to prevent from having the "path" of the file to appear
TIP #6: use the "%random%" command to get random numbers
TIP #7: a label is made by using a colon (:) then text. So to make a label called pie you would do :pie
TIP #8: use the "goto" command to goto a label
TIP #9: use the "set /p input=" command to make an input section
TIP #10: under the "set /p input=" command use "if %input%==(insert whatever here) goto (insert label name here)
TIP #11: anything using a percent sign before and after a word (or number) is called a variable
TIP #12: if you use a variable in a block of text, around the start of the program use the set "name of variable here"="whatever you want it to say"
EXAMPLE: Say you have a variable named %X% and you want it to say seven. You would do "set X=seven"
Steps to get programming:
1) Open Notepad
2) Type the code
3) Save as "name".bat
4) Before you click "save" click on the bar that says "Text Documents" and click "All files"
VERSION 2.0
No comments:
Post a Comment