Command Grouping

Grouping Commands in blocks using Parentesis.

Description: Use parenthesis to group commands into a block. Command blocks are useful in combination with e.g. IF or FOR commands.
An opening parenteses in a line will tell command processor that more lines will follow.
Script: Download: BatchCommandBlock.bat  
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
@ECHO OFF

for /l %%a IN (4,-1,0) do (
    echo.%%a: First  command in block
    echo.   Second command in block
)
echo.
if exist "c:\windows" (
    echo.The c:\windows directory exist.
    set "IsWin=YES"
) ELSE (

    set "IsWin=NO"
)
echo.Is this a windows pc?  %IsWin%
Script Output:
 DOS Script Output
4: First  command in block
   Second command in block
3: First  command in block
   Second command in block
2: First  command in block
   Second command in block
1: First  command in block
   Second command in block
0: First  command in block
   Second command in block

The c:\windows directory exist.
Is this a windows pc?  YES