Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4014904
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:33:13+00:00 2026-05-20T09:33:13+00:00

A client needs an updated copy of a file propagated to about 160 variations

  • 0

A client needs an updated copy of a file propagated to about 160 variations of the same folder structure on a Windows box. can someone help me with a script to automate this? I’m a developer, but a n00b with scripts.

the folder structure looks like:

  • root
    • one
      • layouts
      • components
      • help
    • two
      • layouts
      • components
      • help
    • three
      • layouts
      • components
      • help
    • … x 160

and I need to copy the same file to the ‘components’ folder.

thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T09:33:13+00:00Added an answer on May 20, 2026 at 9:33 am

    Here is a powershell solution I cooked up that should do what you are asking. You willneed to edit the SourceDir, Dest, and the Filter to get the file or files you want.

    $SourceDir = "C:\Source"
    $Dest = "C:\Root"
    $Files = gci -Path $SourceDir -Recurse -Filter "*.txt" |?{$_.Directory -ne $null}
    
    $Index = ($Source.Length)
    $SSFile = $UpdatedPath.Substring($Index)
    $Index = $SSFile.LastIndexOf("\")
    $ChildDir = $SSFile.Substring(0,$Index)
    $Root = Dir -Path $Dest|?{$_.Directory -eq $null}
    foreach ($File in $Files){
        foreach ($Folder in $Root){
            $FolderPath = $Folder.FullName
            $DropPath = ("{0}{1}" -f$FolderPath, $ChildDir)
            Copy-Item -Path $File.FullName -Destination $DropPath
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My client needs the non-compiled code. What's that? My project folder includes: Classes:of course,
A client needs the browser to prompt to save the password for the login
My client needs to have a banner management system installed to their site. They
My client needs a Pocket PC application to remotely configure an industrial sensor via
I'm building a client that talks to the http server. Now my client needs
You may skip this part: I am creating an application where the client needs
I have a product that I distribute to my clients. Each client needs some
I'm working with a Wordpress Theme. It's a product showcase and my client needs
How can I ensure that if I am doing a HTTP file upload (e.g.
I'm writing a system at the moment that needs to copy data from a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.