BATCH SCRIPTING// OPERATORS IN BATCH SCRIPT // Batch Scripting Part -19- OPERATORS
Channel: Techno Puffin
Date: 30/06/2020

UDEMY : https://www.udemy.com/course/learn-basics-of-batch-scripting/?referralCode=3FE5DEA4153D02ED5BB9
Title: BATCH SCRIPTING// OPERATORS IN BATCH SCRIPT // Batch Scripting Part -19- OPERATORS
In this lesson, you will be learning about OPERATORS IN BATCH SCRIPT for Batch Script. 


OPERATOR: An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations.
In batch script, the following types of operators are possible.


ARITHMETIC OPERATORS: Batch script language supports the normal Arithmetic operators as any language. Following are the Arithmetic operators available.
Operator Description                            Example
+ Addition of two operands                    1 + 2 will give 3
− Subtracts second operand from the first        2 − 1 will give 1
* Multiplication of both operands                2 * 2 will give 4
/ Division of the numerator by the denominator   3 / 2 will give 1.5
% Modulus operator and remainder of after an     3 % 2 will give 1
   integer/float division 
   
RELATIONAL OPERATORS: Relational operators allow of the comparison of objects. Below are the relational operators available.


Operator Description                                                                       Example
EQU        Tests the equality between two objects                                        2 EQU 2 will give true
NEQ        Tests the difference between two objects                                        3 NEQ 2 will give true
LSS        Checks to see if the left object is less than the right operand                2 LSS 3 will give true
LEQ        Checks to see if the left object is less than or equal to the right operand    2 LEQ 3 will give true
GTR        Checks to see if the left object is greater than the right operand            3 GTR 2 will give true
GEQ        Checks to see if the left object is greater than or equal to the right operand  3 GEQ 2 will give true




LOGICAL OPERATORS: Logical operators are used to evaluate Boolean expressions. Following are the logical operators available.


The batch language is equipped with a full set of Boolean logic operators like AND, OR, XOR, but only for binary numbers. Neither are there any values for TRUE or FALSE. The only logical operator available for conditions is the NOT operator.
Operator Description
AND        This is the logical “and” operator
OR        This is the logical “or” operator
NOT        This is the logical “not” operator


ASSIGNMENT OPERATORS :Batch Script language also provides assignment operators. Following are the assignment operators available.


Operator Description Example
+=         This adds right operand to the left operand and assigns the result to left operand 
Set /A a = 5
Set /A a += 3
Output will be 8


-= This subtracts the right operand from the left operand and assigns the result to the left operand 
Set /A a = 5
a -= 3
Output will be 2


*= This multiplies the right operand with the left operand and assigns the result to the left operand 
Set /A a = 5
a *= 3
Output will be 15


/= This divides the left operand with the right operand and assigns the result to the left operand 
Set /A a = 6
a/ = 3
Output will be 2


%= This takes modulus using two operands and assigns the result to the left operand 
Set /A a = 5
a% = 3
Output will be 2


BITWISE OPERATORS: Bitwise operators are also possible in batch script. Following are the operators available.


Show Example
Operator Description
& This is the bitwise “and” operator
| This is the bitwise “or” operator
^ This is the bitwise “xor” or Exclusive or operator
=======================================================
If you have any questions, please post them. Don't forget to comment, like, rate and subscribe
=====================================================
Batch file programming tutorial // CREATE BATCH FILE // Batch Scripting Part-1 -- https://youtu.be/IcWYgOtohPg
Batch file programming tutorial // Batch Scripting Part-2 - Basic Batch Commands -- https://www.youtube.com/watch?v=cJ38oF3seus
Batch file programming tutorial // COPY COMMAND // Batch Scripting Part-3 - COPY Batch Command -- https://www.youtube.com/watch?v=d_0Nyxj2Xtg
Batch file programming tutorial // DEL COMMAND // Batch Scripting Part-4 - DEL Batch Command -- https://www.youtube.com/watch?v=iWbEg5SppMk
Batch file programming tutorial // MOVE COMMAND // Batch Scripting Part-5 - MOVE Batch Command -- https://www.youtube.com/watch?v=mUJxJUM6O6o
======================================================
Check out other videos


WEAPONS THAT CAN DEFEAT THANOS -- https://www.youtube.com/watch?v=nvlez
MS PAINT TRICK -- https://www.youtube.com/watch?v=4IvBC
Matrix Effect  -- https://www.youtube.com/watch?v=_EeyZYziH9A
CMD: Wi-Fi Password Hack| Find WiFi Password on Windows 10/8/7/XP -- https://www.youtube.com/watch?v=E4qH6WCq4B0