"if" - Run Command Conditionally
What is the "if" batch command for?
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.
2021-04-02, 975👍, 0💬
Downloading and Installing vStrip "vStrip" is one the most powerful DVD ripper and VOB file processi...
What is the difference between a Web page and a filtered Web page? Word 2007 supports 2 Web page for...
Where to find information about what processes are running on Windows 7 and how to manage them? I wa...
Can I disable Windows service "Spectrum24 Event Monitor" to speedup my computer? Windows service "Sp...
Can I disable Windows service "PCAngel.exe - PC Angel" to speedup my computer? Windows service "PCAn...