SickBoy23
asked on
MS DOS Batch File to Rename & Move Files from nested file structure
Hello,
I would like to modify the following code to recursively move files from c:\pictures to here c:\new pictures and rename them pre-fixed with their sub folder name, can anyone help?
Thanks
I would like to modify the following code to recursively move files from c:\pictures to here c:\new pictures and rename them pre-fixed with their sub folder name, can anyone help?
Thanks
@echo off
setlocal
pushd "c:\pictures"
for /f "tokens=*" %%a in ('dir /b /a-d /s *.jpg') do copy "%%a" "c:\new pictures"
popd
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Steve, if I want to change the paths e.g. move & rename the contents of C:\Temp\NewFolder\Pics to here C:\Temp\NewFolder, how would I do this?
Thanks
ASKER
Ignore the above figured it out, I was doing something stupid!
ASKER
Steve the code works great!! Appreciated!
Thanks