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 109369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:03:30+00:00 2026-05-11T02:03:30+00:00

As the title says, how can I recursively copy a directory structure but only

  • 0

As the title says, how can I recursively copy a directory structure but only include some files. E.g given the following directory structure:

folder1   folder2     folder3       data.zip       info.txt       abc.xyz     folder4     folder5       data.zip       somefile.exe       someotherfile.dll 

The files data.zip and info.txt can appear everywhere in the directory structure. How can I copy the full directory structure, but only include files named data.zip and info.txt (all other files should be ignored)?

The resulting directory structure should look like this:

copy_of_folder1   folder2     folder3       data.zip       info.txt     folder4     folder5       data.zip 
  • 1 1 Answer
  • 1 View
  • 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. 2026-05-11T02:03:31+00:00Added an answer on May 11, 2026 at 2:03 am

    You don’t mention if it has to be batch only, but if you can use ROBOCOPY, try this:

    ROBOCOPY C:\Source C:\Destination data.zip info.txt /E 

    EDIT: Changed the /S parameter to /E to include empty folders.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think the title says it, as well...but of course some more explanation assume
The title pretty much says. I need to open all the PowerPoint files recursively
As the title says. Can some give me instructions how to do this as
As the title says, how can I achieve the following in ruby using regex
Like the title says, in oracle you can issue the following command in SQL*Plus:
As title says, i know that new throws an exception which can be caught,
As the title says, can I do this with a POSIX file descriptor? In
As the title says, I would like to know where or how you can
As it says in the title , how can I tell if the mysql_real_escape_string
As title says for some purpose I need to get the size of request/response

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.