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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:56:14+00:00 2026-06-10T13:56:14+00:00

I have one folder called OLD . There is a directory structure inside it

  • 0

I have one folder called OLD. There is a directory structure inside it like:

Old  
---DSL  
---------CI  
------------AppFolder1    
------------AppFolder2  
---------------------------FUN2    
--------CA  
------------AppFolder1  

Inside each folder there may or may not be files.

I have one folder called NEW, which has the updates and the depending upon the changes appropriate directory structure is inside it. The point is that it will be same as OLD. For example:

NEW  
---DSL  
---------CI  
------------AppFolder2  
---------------------------FUN2  
--------CA    

As you can see the directory structure (including folder names) as same. I want all files in NEW to replace appropriate files in OLD.

Please provide me a starting point for it.

  • 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-06-10T13:56:16+00:00Added an answer on June 10, 2026 at 1:56 pm

    I created a folder Old with the structure:

    Old Root C:\Old for example.

    -Old
    --CI
    ---AppFolder1
    ---AppFolder2
    

    And New which had nothing in it.

    Then ran the console app I made setting the NewRoot to C:\New and got:

    -New
    --CI
    ---AppFolder1
    ---AppFolder2
    

    Not sure if this is the sort of thing you were looking for – if not advise what you want to be done differently 🙂

    private static void SyncDirectories(string oldRoot, string newRoot)
    {
      CreateDirectoriesRecursive(Directory.GetDirectories(oldRoot), newRoot);
    }
    private static void CreateDirectoriesRecursive(string[] oldDirectories, string root)
    {
      foreach (string oldDirectory in oldDirectories)
      {
        string directoryToCreate = root + @"\" + new DirectoryInfo(oldDirectory).Name;
        if (!Directory.Exists(directoryToCreate))
          Directory.CreateDirectory(directoryToCreate);
        if (Directory.GetDirectories(oldDirectory).Count() > 0)
          CreateDirectoriesRecursive(Directory.GetDirectories(oldDirectory), directoryToCreate);
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one main directory called Forfun . Inside this directory, there are 7-8
I have one created one folder called MYFOLDER inside my folder in have one
Suppose i have one folder and inside that another two files are there .
Hi I have created a user control which is inside a folder called Controls
Strange situation. inside a solution I have several projects. One of them is called
I have a folder called week1, and in that folder there are about ten
I have one folder called 'Data' that contains all files with current date in
I have one folder synced between two computers (using one of online sync tools).
I have one folder with about 1000 files and I want to group them
I have one solution with 3 folders (Forms, Notices, Reports). In the Notice folder

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.