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, ∼3184🔥, 0💬
Popular Posts:
Signing in on my computer that doesn't run 8 works just fine. So must be windows eight that is causi...
What is the "Security Accounts Manager (SamSs)" system service on Windows Server 2008? Can I disable...
Can I disable Windows service "Performance Logs and Alerts" to speedup my computer? Windows service ...
Why am I getting a blank page when running PHP scripts to access MySQL database? Assuming that you h...
What is the startup program "CyberLink MediaLibray Service - CLMLSvc_P2G8.exe" on my Windows 8 compu...