Space - Delimiter for Batch File Parameters

Q

What is the character to separate batch file parameters?

✍: FYIcenter.com

A

When you specify parameters to invoke a batch file, the space character is used as the delimiter to separate parameters.

For example, if you enter "Batch-File-Parameters.bat 1 2 3 4 5", you are providing 5 parameters to the batch file.

Multiple space characters entered together are used as a single delimiter.

Here are more examples on how space characters are used as the delimiter to separate batch file parameters:

C:\fyicenter>Batch-File-Parameters.bat 1 2  3   4    5
(Batch-File-Parameters.bat)
(1) (2) (3) (4) (5)
(1 2  3   4    5)

C:\fyicenter>Batch-File-Parameters.bat       1 2  3   4    5
(Batch-File-Parameters.bat)
(1) (2) (3) (4) (5)
(1 2  3   4    5)

C:\fyicenter>Batch-File-Parameters.bat       1 2  3   4    5 < nul
(Batch-File-Parameters.bat)
(1) (2) (3) (4) (5)
(1 2  3   4    5)

 

Quotations in Batch File Parameters

%1 and %* - Receive Parameters in Batch File

Introduction of Windows Batch File

⇑⇑ Windows Batch File Tutorials

2017-12-05, 211👍, 0💬