Batch moving multi files fr multi dir

Solved/Closed
LiLi - Dec 22, 2009 at 08:12 AM
 Hawk - Dec 23, 2009 at 10:37 AM
Hello,
My name is Lisa.

I would like a batch file to move multiple files from multiple directories to one directory on one
drive. Example:

C:\Can\Prod\AMD\Detail\Proc\*.*
C:\Can\Prod\AMD\Sum\Proc\*.*
C:\Can\Prod\PMD\Detail\Proc\*.*
C:\Can\Prod\PMD\Sum\Proc\*.*
C:\Can\Prod\SMD\Detaiil\Proc\*.*
C:\Can\Prod\SMD\Sum\Proc\*.*
C:\Can\Prod\KMD\Detail\Proc\*.*
C:\Can\Prod\KMD\Sum\Proc\*.*
Related:

1 response

Hi Lisa,

You can try with the below script,

@echo off

for /f "Tokens=* delims= " %%g in ('dir /b /s "C:\Can\Prod" ^| find "\Proc\"') do move"%%g" "destination path"

Note:

The destination path should finish like " D:\test\". Path should end with the slash (\).

Reg - Pradeep
1