Skip to main content

Posts

Batch Lesson : Beginner #3

Recent posts

Batch Lesson : Beginner #2

In this lesson, you will learn about variables.  How to create them, modify them, and use them in your code.  Variables are used to store strings of text.  In batch, they are represented as the variable name, surrounded by percent symbols: %myVar%.  To set a variable, use the set command like this:      set abc=1234      echo %abc% This will create a variable called 'abc', that expands to the value '1234'.  Then, the program will display the text '1234' through the echo command.      set abc=12      echo %abc%      set abc=34      echo %abc% This program will display the text '12', then on a separate line, '34'. You can also set the value of a variable to nul(nothing) like this:      set var= This is different that setting the variable to 0 because this gives an output of nothing, not 0. Parameters...

Batch Lesson : Beginner #1

Batch programming is the basic command line scripting language used in windows.  Is uses simple MS-DOS commands to execute a variety of tasks and functions ranging from simple sorting of strings to modifying system settings and files.  It is a necessary language to know in almost any computer related job. In this lesson, you will be learning about a few basic commands used to display text in the command window. As batch is a command line programming language, all of the display is shown in a Command Prompt window that looks like this: To create a batch file, you must write all of your code into notepad, then save the file somewhere to your computer, as yourfile.bat . The 'echo' command is used to display text in the command window.  The command is used like this:      echo your text here If you opened your program that only contained the echo command, it would display the text but then instantly close.  To pause t...