
Prerequisites for batch scripting are minimal; CMT is by default available for Windows operating systems. Edit scripts with Visual Studio Code or Notepad, and install the batch extension.
Learn how to display messages on the console using the echo command, including strings and numbers, and how to hide commands with @echo off to show only the output.
Define variables with set in batch scripting, assign strings or numbers, and display with echo using %variable%; avoid treating variables as commands unless explicitly invoked.
Explore environment variables in batch scripting by using set to display variables and values, reference predefined variables like the system root variable, and switch directories to list files.
Declare a sum as 10+10 using /A, then display the computed result in batch scripting. Explore arithmetic, logical, and bitwise operators, and view command details with /?.
Learn to capture user input in batch scripting by displaying prompts, storing responses in variables, and performing simple arithmetic with two numbers to display a result.
Learn how batch scripting uses command arguments as input data, with examples like passing your name and listing C:\Windows directories, and displaying the volume serial number.
Define and call functions in batch scripting using labels, group multiple functions, and manage control flow with goto to avoid looping issues.
Master batch scripting by applying functions with goto and exit to control flow, call and display functions, and exit the current batch without closing the entire session.
Learn to implement local scope in batch scripting by using local declarations to keep variables like name and number confined to a block, preventing them from becoming global.
Master the batch scripting if statement by defining conditions with operators such as equals, not equal, less than, and greater than; use variables and conditional execution.
Learn how the else statement runs when an if condition is not true in batch scripting, handling wrong paths and displaying messages.
Learn to use a for loop in batch scripting to generate a range from zero with one-step increments, ending at a limit, and print each value to the console.
Discover how to use errorlevel in batch scripting to detect command success (zero) or failure (nonzero), handle user input, and branch logic with if statements.
Learn to redirect command output to a log file in batch scripting using > to create or overwrite and >> to append outputs to a single file.
This course is designed to give you basic ideas about Batch Scripting.
Batch Scripts are stored in simple text files containing lines with commands that get executed in sequence, one after the other. Scripting is a way by which one can alleviate this necessity by automating these command sequences to make one’s life at the shell more comfortable and more productive. This tutorial discusses the basic functionalities of Batch Script along with relevant examples for easy understanding.
What will you learn?
1. Introduction of batch scripting
2. Batch scripting Prerequisite
3. How to use the Echo command to print output
4. How to use @ Symbol in Scripting
5. How to use Variables in Scripting
6. Write comment section block
7. Create Environment Variables and use them in Scripting
8. How to create string and Concatenate multiple strings
9. How to use Mathematical Expression
10. How to use Input Command in Batch Scripting
11. How to Write Command Arguments
12. How to create Basic Functions
13. Function explanation using GOTO and Exit
14. How to create Function Argument
15. Create Local Scope in Script
16. How to Create IF Statement
17. How to write Else Statement
18. How to Create For loop
19. How to write Error level
20. And finally how to write log files for your Scripts
Thank You,
Rahul Sawant