Collections:
Other Resources:
"if" - Run Command Conditionally
What is the "if" batch command for?
✍: FYIcenter.com
The "if" command is for running a command conditionally.
Below is the "if" command syntax:
if condition command1 [else command2]
When the "if" command is executed, the specified condition will be evaluated first. If the condition is true, "command1" will be executed. If the condition is false and the "else" clause is provided, "command2" will be executed.
Here is an example on how to use the "if" command:
IF EXIST filename (DEL filename) ELSE (ECHO filename missing)
Notice that the "(DEL filename)" child command is enclosed in parentheses to end it before the ELSE keyword. Without parentheses ELSE will be considered as another file to be deleted.
⇒ "goto" - Change the Execution Flow
2021-04-02, ∼2376🔥, 0💬
Popular Posts:
How to verify if your system is connected to the wireless network? Windows system has two commands "...
What is "Health Key and Certificate Management" in my Windows XP service list? And how is "Health Ke...
What is "SMS Agent Host" in my Windows 7 service list? And how is "SMS Agent Host" service related t...
How to download Windows 7 Service Pack 1 (SP1)? Windows 7 Service Pack 1 (SP1) is an update for all ...
What is the difference between a Web page and a Single File Web Page? Word 2007 supports 2 Web page ...