"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 consided as another file to be deleted.
2017-12-05, 193👍, 0💬
Everytime when connect a USB device the volume lowers by 80% It happen with Soundblaster Audigy SE a...
How to Verify Apache server configuration for PHP scripts support? If you have followed our Configur...
Can I remove startup application "tfswctrl.exe - Sonic Drive Letter Access Component" to speedup my ...
How to dump the list of all processes that are running on my Windows 7 system? I want save names of ...
What is the startup program "IDT PC Audio - sttray64.exe" on my Windows 8 computer? Can I remove it ...