Login Register


Beginner Vocabulary #1 filter_list
Author
Message
Beginner Vocabulary #1 #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."

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. pause

Alternate 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. pause

Result:

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 c


Result:

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? pause

Result:

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 pause

Result:

*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.

Reply

RE: Beginner Vocabulary #1 #2
Thanks for throwing in these vocab terms. Really should pick up in my batch scripts again.

Reply

RE: Beginner Vocabulary #1 #3
As with 'echo.' you can also use 'echo\' just as a mention. You also don't require 'start' to execute a program, although the result of using 'start' and not using it is slightly different at execution time.

Reply







Users browsing this thread: