Beginner Vocabulary #1 01-24-2014, 10:43 PM
#1
Note: @echo off stops the extra command prompt information from showing.
also ignore the parentheses in the first two. They are just to show
specifically what is happening from which code.
To create a batch program, simply open Notepad.exe, and when you go to save
save as ____.bat, under "All Files."
also ignore the parentheses in the first two. They are just to show
specifically what is happening from which code.
To create a batch program, simply open Notepad.exe, and when you go to save
save as ____.bat, under "All Files."
Vocabulary:
echo The main output for strings(phrases of text). This is to give the person
running the program some idea of what they are required to do or
to give them information.
Example Code:
Code:
@Echo off
Echo Welcome to my program.
echo.
pauseAlternate Use: "Echo." can be used to divide lines with a space.
Result:
Code:
((Welcome to my program.))
Press any key to continue...pause Tells the program to wait for user to input a key stroke.
Example Code:
Code:
@Echo off
Echo Welcome to my program.
echo.
pauseResult:
Code:
Welcome to my program.
((Press any key to continue...))goto Causes the code to jump to its denoted marker. In this situation, it moves from the start,
to variable "a", to variable "c." For example if you were to write "goto loop", you must declare a marker
named "loop". This can be done by simply writing it by itself on a line with a semi colon in front.
Example Code:
Code:
:b
Hello!
pause
goto a
:c
cls
echo Hello again!
pause
cls
:a
echo 13
pause
goto cResult:
Code:
Hello!
Press any key to continue...Code:
13
Press any key to continue...Code:
Hello again!
Press any key to continue...cls Clears the screen of all writing.
Example Code:
Code:
@echo off
echo Hello.
pause
cls
echo How're you?
pauseResult:
Code:
Hello.
Press any key to continue...Code:
How're you?
Press any key to continue...start Can be used to open programs, or even open webpages.
Example Code:
Code:
@echo off
start www.yahoo.ca
start firefox.exe
pauseResult:
*Opens yahoo.ca on default browser*
*Opens firefox browser*
Any questions, feel free to PM me. I'll be writing a part two this weekend.
"Fuck Batman and Robin. I'm robbin with a bat, man."
Computer running slow? Click here for help.
Computer running slow? Click here for help.
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)