$directory = "c:\whatever"
$file = "file.jpg"

$files = dir -Path $directory -Include $file -Recurse
foreach( $f in $files )
{
                copy $file $f.FullName
}

Regards,

Michael B. Smith
Consultant and Exchange MVP
http://TheEssentialExchange.com

From: Sam Cayze [mailto:[email protected]]
Sent: Tuesday, December 20, 2011 12:00 PM
To: NT System Admin Issues
Subject: Recursive File Copy?

Need to replace file.jpg with a new version of file.jpg across about 100 
directories.
Googling, but coming up short and found some scripts that don't quite work... 
feel like I'm wasting time when it should be easy, and thought the brains here 
probably have done this before with ease...

Sam



~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to 
[email protected]<mailto:[email protected]>
with the body: unsubscribe ntsysadmin

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to [email protected]
with the body: unsubscribe ntsysadmin

Reply via email to