Bitwise operators are available in Batch Script.
The following table lists the available bitwise operators.
| Operator | Description |
|---|---|
& |
This is the bitwise and operator |
| |
This is the bitwise or operator |
^ |
This is the bitwise xor or exclusive or operator |
Example
The following code snippet shows how the various operators can be used.
@echo off
set /A "Result = 48 & 23"
echo %Result%
set /A "Result = 16 | 16"
echo %Result%
set /A "Result = 31 ^ 15"
echo %Result%16
16
16