Batch moving multi files fr multi dir [Solved/Closed]

Report
-
 Hawk -
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\*.*

1 reply

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
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 4235 users have said thank you to us this month