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.
I think you can create a batch file to do this.
The pseudo-code:
The code:
Create a file called
swapFiles.batin your notepad, and enter the following code:How to use it:
directory1is theolddirectory (i.e. the one that will be wiped out)Hope this helps you