Reputation: 35
I am looking for a .bat file that can look inside multiple folders that contain sub-folders that are named the same and move their contents to a specified folder.
Folder Structure:
Main_folder
I need all image files moved from their Textures_subfolder to the MainTextures_folder.
Thanks for any help.
Upvotes: 3
Views: 3243
Reputation: 41234
This expects model* folders under the props folder, and that each model* folder has a textures folder. The MainTextures folder is in the Main_folder.
It's untested and should move all files from each textures folder into the MainTextures folder.
@echo off
pushd "Main_folder\Props"
for /f "delims=" %%a in ('dir model* /b /ad') do (
move /-y "%%a\textures\*.*" "..\MainTextures"
)
popd
Upvotes: 4
Reputation: 3756
for /r "Props_folder" %%x in (*.jpg *.png *.bmp *.whatever) move "%%~fx" "MainTextures_folder"
This code will overwrite all existing files.
Upvotes: 2