copy and paste a file into subfolders

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
tonyjms2005
Posts: 1
Joined: 11 Apr 2014 05:10

copy and paste a file into subfolders

#1 Post by tonyjms2005 » 11 Apr 2014 05:14

Hello
I have a file called file.csv located in a folder of which the batch file will be located.
I want to copy and paste the file.csv into ALL subfolders within the folder containing the batch and csv file.

The subfolders can change anytime.

Thanks in advance

Antony

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

Re: copy and paste a file into subfolders

#2 Post by foxidrive » 11 Apr 2014 05:55

Test this:

Code: Select all

@echo off
for /d /r %%a in (*) do copy "file.csv" "%%a"

Post Reply