Folder c:\folder1
contains subfolder1
, subfolder2
, etc..
These subdirectories hold .pdf
and .db
files.
How can all the .pdf
files be moved to c:\folder1
using the Windows command interpreter?
This worked for me:
.bat
/ .cmd
file:for /r "c:\source_directory\" %%x in (*.pdf) do move "%%x" "c:\target_directory\"
for /r "c:\source_directory\" %x in (*.pdf) do move "%x" "c:\target_directory\"
This command will copy recursively all *.pdf
files from the source (and all of its subdirectories) to the target directory.
To exclude files in subdirectories omit the /r
switch.
Hope it helps.