Saturday, March 29, 2014

Windows Batch Scripting Tips

Find files recursively

for /r %%f in (*.abc) do echo %%f

or

for /f "delims=|" %%f in ('dir /B /S *.abc') do echo %%f

Block of statements

(The parentheses must be used exactly as shown)

if %VAR% == 0 (
    echo "statement 1"
    echo "statement 2"
)

No comments:

Post a Comment