views:

25

answers:

2

I need copy credits.jpg from C:\Users\meotimdihia\Desktop\credits.jpg to D:\Software\destinationfolder and all subfolders I read many and i write

/R "D:\Software\destinationfolder" %%I IN (.) DO COPY "C:\Users\meotimdihia\Desktop\credits.jpg" "%%I\credits.jpg"

then i save file saveall.bat but i run it , it dont work at all. help me write 1 bat

+2  A: 

Give this a try:

for /r "D:\Software\destinationfolder" %i in (.) do @copy "C:\Users\meotimdihia\Desktop\credits.jpg" "%i"

Of course, if it's to go into a batch file, double the '%'.

BillP3rd
thanks it work ^^
meotimdihia
A: 

If you can use it: Here is a PowerShell solution (PowerShell is integrated in Windows 7 and available from XP and up):

$file = "C:\...\yourfile.txt"
$dir = "C:\...\YourFolder"

#Store in sub directories
dir $dir -recurse | % {copy $file -destination $_.FullName}
#Store in the directory
copy $file -destination $dir

I'm pretty sure that the last line can be integrated in dir ... but I'm not sure how (I do not use PowerShell very often).

lasseespeholt