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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:00:46+00:00 2026-05-27T10:00:46+00:00

My directory structure looks like this; folder1 folder2 (thousands of folders like this) folder3

  • 0

My directory structure looks like this;

folder1
  folder2 (thousands of folders like this)
    folder3
        someImage.jpeg
        someDoc.doc
        folder4 (optional folder)
           someImage.jpeg
           someDoc.doc

I want the script to copy the folder 2s which contain folder 4s maintaining the folder structure but only copying the files in folder 4. Like this;

folder1
  folder2 (thousands of folders like this)
    folder3
      folder4 (optional folder)
        someImage.jpeg
        someDoc.doc

I’ve got a simple for loop which can identify the folders which contain folder 4 and then Robocopy the files to some directory. I can’t figure out how to copy the entire folder structure whilst skipping the files at folder 3.

  • 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-27T10:00:47+00:00Added an answer on May 27, 2026 at 10:00 am

    There is an option in the xcopy command that creates the directory tree.

      /T           Creates directory structure, but does not copy files. Does not
                   include empty directories or subdirectories. /T /E includes
                   empty directories and subdirectories.
    

    Do it first and then merely copy the files inside folder 4s.

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

Sidebar

Related Questions

I have a directory structure that looks like this: /a/f.xml /b/f.xml /c/f.xml /d/f.xml What
So, I have an app/assets/stylesheets/ directory structure that looks something like this: |-dialogs |-mixins
My directory structure looks like the following: project/ app1/ app2/ settings.py From within the
I have a directory structure something like this: base subdir1 subdir2 subdir3 subsubdir1 subsubdir2
I have a project structure that looks like the following: [Solution Name] doc (documentation)
I have a problem. The structure for my website looks something like this. root
I have a data model for a directory type structure that looks something like
The file structure looks like this root root/x root/x/y.php root/index.php .htaccess code RewriteRule (.*)
the directory structure I'm trying to achieve would be this: application/default/views/layouts/layout.phtml application/default/views/scripts/index/index.phtml application/admin/views/layouts/layout.phtml application/admin/views/scripts/index/index.phtml
I have a directory structure like the following; script.php inc/include1.php inc/include2.php objects/object1.php objects/object2.php soap/soap.php

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.