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, 2103🔥, 0💬
Popular Posts:
What is lsass.exe process - LSA Shell (Export Version)? Process lsass.exe is the Local Security Auth...
Can I remove startup application "tfswctrl.exe - Sonic Drive Letter Access Component" to speedup my ...
What is "Application Identity" in my Windows 7 service list? And how is "Application Identity" servi...
What is realsched.exe process - Real Player RealNetworks Scheduler? Process realsched.exe is a backg...
I am unable to copy data from my external hard-disk (NTFS). When I try to repair it from cmd using c...