Collections:
Other Resources:
%1 and %* - Receive Parameters in Batch File
How to receive parameters in batch file?
✍: FYIcenter.com
If a batch file is invoked with parameters,
you receive them in special variables:
Here is batch file called, Batch-File-Parameters.bat, that displays those special variables holding batch file parameters:
@echo off echo (%0) echo (%1) (%2) (%3) (%4) (%5) echo (%*)
if you run the above batch file with different parameters, you get:
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"
(Batch-File-Parameters.bat)
("1 2") (3) ("4 5") () ()
("1 2" 3 "4 5")
⇒ Space - Delimiter for Batch File Parameters
⇐ "echo on|off" - Control Echo Setting
2021-07-10, ∼3334🔥, 0💬
Popular Posts:
Can I remove startup application "reader_sl.exe - Adobe Acrobat Reader Speed Launch" to speedup my c...
How to setup a HP laptop computer? I want to buy the new HP laptop computer on sale at Best Buy for ...
What is service "AEADIFilters" and program "AEADISRV.EXE" on Windows Vista? "AEADIFilters" is a syst...
How to Add MP3 Folder to Windows Media Player Library ? 1. Start Windows Media Player. 2. Click the ...
How to tell Apache server to transform (rewrite) URL? Assuming that you have your Apache server runn...