Differences between revisions 1 and 3 (spanning 2 versions)
Revision 1 as of 2022-05-11 17:09:23
Size: 699
Comment:
Revision 3 as of 2023-01-30 02:44:09
Size: 871
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= Batch File = = Batch =
Line 3: Line 3:
On the [[Windows|Windows operating system]], '''batch files''' are interpreted scripts. In any modern Windows versions, a batch file is interpreted by `cmd.exe`. [[Windows|Windows]] is to '''batch scripting''' as [[Linux]] is to [[Shell/shell scripting]]. In any modern Windows operating system, a batch file is interpreted by `cmd.exe`.
Line 12: Line 12:

A hello world program looks like:
Line 38: Line 36:
 * [[BatchFile/Variables|Variables]]
 * [[BatchFile/Looping|Looping]]
 * [[Batch/BuiltinCommands|Builtin commands]]
 * [[Batch/Expansion|Expansion]]
 * [[Batch/Logic|Logic]]
 * [[Batch/Looping|Looping]]
 * [[Batch/Pipeline|Pipelines]]
 * [[Batch/Quoting|Quoting]]
 * [[Batch/Redirection|Redirection]]
 * [[Batch/Variables|Variables]]

Batch

Windows is to batch scripting as Linux is to Shell/shell scripting. In any modern Windows operating system, a batch file is interpreted by cmd.exe.


Example

@ECHO OFF
ECHO Hello World!
PAUSE

The file name must end in .bat or .cmd (case-insensitive).

Executing this will open a terminal window and print:

Hello World!
Press any key to continue . . .

The program will wait for any keyboard input and then exit.


Language


CategoryRicottone

Batch (last edited 2023-01-30 18:30:02 by DominicRicottone)