Link to home
Start Free TrialLog in
Avatar of samiam41
samiam41Flag for United States of America

asked on

Copy one file to multiple directories w/ batch file

Greetings Experts.  I have a spreadsheet that needs to be copied to a set of top level folders but not the sub-folders.  Having most of my experience in scripting coming from batch files, please aim your response in that direction.

file A needs to go to folders A-Z:

FolderA [yes]
--sub folderA [no]
Folder B [yes]
--sub folderB [no]

I asked a similar question before on here but can't find it nor the solution.  I appreciate your time and help with this one!!
Avatar of Member_2_6492660_1
Member_2_6492660_1
Flag of United States of America image

@echo off
CD \
cd \to folder where your spreadsheet is
copy  spreadsheet.xls c:\foldera\spreadsheet.xls
copy  spreadsheet.xls c:\folderb\spreadsheet.xlscopy  spreadsheet.xls c:\folderc\spreadsheet.xls
etc
etc
etc
copy  spreadsheet.xls c:\folderz\spreadsheet.xls
EXIT
ASKER CERTIFIED SOLUTION
Avatar of lharrison26
lharrison26
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of samiam41

ASKER

Thanks Experts.  Testing now.
One line of code and the task was finished.  I appreciate everyone's help and look forward to working with you all again soon.  Thanks.
Glad to help.