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, 1994🔥, 0💬
Popular Posts:
What is "SSDP Discovery" in my Windows 7 service list? And how is "SSDP Discovery" service related t...
Can I disable Windows service "Network Location Awareness (NLA)" to speedup my computer? Microsoft a...
What are default background services on a Windows 7 Home Premium computer? If you are running a Wind...
My mail cannot sync and there is a message that my email address is not available when I click on th...
How can I get detailed system information from my Windows Server 2012? A quick way to get detailed i...