Batch to copy files with specific extension


By: jqjo
August 8, 2011

Here the code, I hope you find this hopefully.

@echo off

rem search for all files in current dir and subdir which catch the desired extension
for /r %%a in (*.swf) do (
    rem for each file caught exclude files wich are in undesidered path
    for /f %%b in (' echo %%a ^|find /V "PATH1" ^|find /V "PATH2" ') do (
    rem in this case I use xcopy but anything are possible
    xcopy %%b somepath
    )
)


Need more help?
Describe your Problem
Example: Hard Drive Not Detected on My PC

Ask Question