Difference between revisions of "Windows Batch Script"

From PKC
Jump to navigation Jump to search
Line 8: Line 8:
==Useful Hints==
==Useful Hints==
The following special expressions or characters may be useful in understanding Batch Script:
The following special expressions or characters may be useful in understanding Batch Script:
=== SET /A===
  SET varibale_name=variable_value
  SET varibale_name=variable_value
  :: for assigning numeric value
  :: for assigning numeric value
  SET /A variable_name=nameric_value
  SET /A variable_name=nameric_value
‘/A’ is used for assigning numeric values. Uninitialized variables are empty strings in batch files.
‘/A’ is used for assigning numeric values. Uninitialized variables are empty strings in batch files.
=== FOR /L===
FOR /L %%var_name IN (Lowerlimit, Increment, Upperlimit) Do some_code
*‘/L’  signifies that for loop is used for iterating through a range of values.
*Lower limit is the value from which loop will start until it reaches the Upper limit and the increment is the value with which lower limit will be increased during each iteration

Revision as of 13:08, 18 August 2021

Windows Batch Script is a crucial instrument for setting up PKC on Windows 10 platform.

Useful Websites

  1. Batch Script Tutorial on Tutorial Point
  2. Batch File to Create Formatted Date and Time
  3. Batch File Programming

Useful Hints

The following special expressions or characters may be useful in understanding Batch Script:

SET /A

SET varibale_name=variable_value
:: for assigning numeric value
SET /A variable_name=nameric_value

‘/A’ is used for assigning numeric values. Uninitialized variables are empty strings in batch files.

FOR /L

FOR /L %%var_name IN (Lowerlimit, Increment, Upperlimit) Do some_code
  • ‘/L’ signifies that for loop is used for iterating through a range of values.
  • Lower limit is the value from which loop will start until it reaches the Upper limit and the increment is the value with which lower limit will be increased during each iteration