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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:23:18+00:00 2026-06-18T03:23:18+00:00

So far I have it to where I can copy all the files from

  • 0

So far I have it to where I can copy all the files from c:\Users\John\Folder1 to c:\Users\John\Folder2.

But I am looking to completely swap the folders.

e.g. Replace c:\Users\John\Folder1 with c:\Users\John\SomeFolder\Folder1.

I have this right now: xcopy c:\Users\John\SomeFolder\* c:\Users\John\Folder1 /s /i

This just copies all the files from the c:\Users\John\SomeFolder\Folder1 to c:\Users\John\Folder1 but leaves the files that had been there prior. I want the entire folder to be replaced. If the new folder I am copying no longer has those files, I want them deleted.

Sorry if this is confusing – any help is greatly appreciated.

  • 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-18T03:23:19+00:00Added an answer on June 18, 2026 at 3:23 am

    I think you can create a batch file to do this.

    The pseudo-code:

    1. Erase contents of directory 1
    2. Copy the contents from directory 1 to directory 2

    The code:
    Create a file called swapFiles.bat in your notepad, and enter the following code:

    rd /s %1
    mkdir %1
    xcopy /s /i %2\* %1
    

    How to use it:

    swapFiles c:\Users\directory1 c:\Users\directory2
    

    directory1 is the old directory (i.e. the one that will be wiped out)

    Hope this helps you

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

Sidebar

Related Questions

How can I add arrow in qTip. So far I have $('.jym').qtip( { content:
I'm fairly new to JS, here's what I have so far. I can get
I have this trigger which works functionally (as far as I can tell by
I have not done any animation stuff with iphone development so far. Can anybody
So far I have only been updated a view from within its controller. I
So far I have the expression: http://[^\.]*\.mydomain\.com/((.*?)) Which matches... http://www.mydomain.com/Images/favicon.ico But I really dont
So far I have been creating Web Portal but recently I had a request
I'm new to VBScript. I cannot find a way to copy files from one
I need to open all Excel files that are in a folder, and copy
In Visual Studio 2008, I can see all my project files in my Solution

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.