What Are Batch Variables

Q

What What Are Batch Variables?

✍: FYIcenter.com

A

Batch variables are variables that create, store value to and retrieve value from in a batch file.

There are 3 ways a batch variable is defined:

1. Defined in the batch file using the "set" command. For example, "set java_home=\fyicenter\java" will define a new variable, "%java_home%".

2. Defined as system environment variables before the batch being executed. For example, "%path%" is a variable defined as a system environment variable.

3. Defined as batch execution context built-in variables. For example, "%random% is a batch built-in variable that represents a random integer.

2022-02-04, 1236👍, 0💬