BATCH SCRIPTIG
1. Script : A script is a program or sequence of instructions in computer programming
that is interpreted or executed by another program rather than directly by the
computer's hardware. It's used for automating tasks, controlling software
applications, or processing data.
2. Script language : A script language, or scripting language, is a type of
programming language designed for writing scripts that are executed at runtime.
[Unlike traditional programming languages that are typically compiled, scripting
languages interpret the instructions directly, allowing for quick modifications and
execution.]
3. Scripting : Scripting is the act of writing a script, which is a set of instructions
that tells a computer what to do and when to do it.
4. Scripters : Individuals who write scripts are called Scripters.
Batch scripting is a method of programming that consists of a series of commands
executed by the command-line interpreter in an operating system.
Or,
Batch script is a text file containing a series of commands that are executed in
sequence by the command-line interpreter in Windows. These commands automate
tasks by running multiple instructions as a single batch file.
_
BATCH SCRIPTIG
_______________________________________________________________________________
Different commands of the Batch script :
1.@echo : Deliberately used with certain attributes to print or not print something.
i>@echo on: Print both the commands along with their location also showing the output given
by the scripter.
ii>@echo off: Print only the necessary output given by the Scripter.
**Default is ON
2. pause : It is used to stop the execution or the script simply by pressing any key from the
keyboard.
3. Title : Used to set the title of the Script.
4.start : Used to open different URLs/files/folders/applications.
5.exit : Used to exit the batch file.
6.move :Used to move files from one folder to another.
Remember: <location of file> <location of folder>
7.set : it is normally used to set the promt.
Syntax : set /p <variable name> = <message>
8.goto : Used for looping statemets[Helps us to go to the beginning].
Syntax : goto <any point> ----------- <any point> should be from where you again want to go.
9.cls : clear screen.
10.if else & if not defined :These statements are used to manipulate the flow of direction in the
script.
11.mkdir : Used to create a folder on a specific location in your pc.
12.cd : Used to change the directory.
13.for in do statement :Used to loop a statement.
Syntax: for %%<Variable name> in (*.*) do echo %%<Variable name> >><name of the file>.type