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, 1598🔥, 0💬
Popular Posts:
Can I disable Windows service "Intel NCS NetService" to speedup my computer? Windows service "Intel ...
What is "WWAN AutoConfig" in my Windows 7 service list? And how is "WWAN AutoConfig" service related...
What is "Lenovo Microphone Mute" in my Windows 7 service list? And how is "Lenovo Microphone Mute" s...
What is the file extension .IFO on a DVD-Video disc? .IFO is the file extension used on a DVD-Video ...
Removing Trojan Vundo with FixVundo.exe from Symantec 1. Downloaded FixVundo.exe from http://securit...