newbie needs some help :)

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
daviddc114
Posts: 19
Joined: 23 Jul 2013 12:45

newbie needs some help :)

#1 Post by daviddc114 » 23 Jul 2013 12:50

i am trying to write a batch file that will take a bunch of subdirectories, and duplicate whats inside each one. in other words i will have a directory containing say five folders named 1 2 3 4 5, and in each folder there will be 1 picture (a different photo in each folder). i want a batch file to keep the folder structure the same so i still have folders 1 2 3 4 5, but instead of 1 picture in each folder i want there to be 2, the same picture duplicated. so image 1, and image 1 (copy).

thanks..

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: newbie needs some help :)

#2 Post by foxidrive » 23 Jul 2013 18:39

Code: Select all

@echo off
for /r %%a in (*) do copy "%%a" "%%~dpna-copy%%~xa"

Post Reply