Good morning, this is my request, if you can help me:
I have some folders (A, B, C..) and every folder has some subfolders (the subfolders of folder A will be A1, A2, A3..). Every subfolder has some .txt files.
My aim is, through a batch file and I think through a for cycle,
to create, in every subfolder, a single.txt file that will be the the copy of all txt in that folder
Something like:
for (A1, .. A3, B1,...,B3,C1,...)
copy *txt single.txt
Thank you.
Same instruction in all subfolders
Moderator: DosItHelp
Re: Same instruction in all subfolders
Something like that may work for you:
Steffen
Code: Select all
@echo off &setlocal
for %%i in ("A" "B" "C") do (
for /d %%j in ("%%~i\*") do (
copy "%%~j\*.txt" "%%~j\single.txt"
)
)
Steffen