[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


DOS Command to Move All Folders

Posted on 2012-08-22
Medium Priority
Last Modified: 2012-08-22
I was running out of room and moved some files over to an external HD.  I found out where all my large files were so I robocopied them over.

Now the other files on J:\Users\coreybryant\My Documents\ can be moved back to C:\Users\coreybryant\Documents

Now, just in case there is a copy of the folder (it shouldn't be), robocopy what should I put in there to make sure it will only be overwritten if new?  

I know I need to put /E to copy empty folders.

Thank you!
Question by:coreybryant
  • 4
  • 2
LVL 85

Accepted Solution

oBdA earned 2000 total points
ID: 38321178
By default, robocopy will copy over an existing file if it differs in size or date.
To make sure robocopy doesn't copy older files over newer ones, you need to add /XO (eXclude Older).
For testing, you can add "/L" as well; this tells robocopy to only log, but not actually do anything.
LVL 28

Expert Comment

ID: 38321230
There is  a freeware software. you can specify what you want to do
search for allwaysync in Google
LVL 29

Author Comment

ID: 38321847
I will only need to do this really once.  

I actually want to overwrite if new.  The folders / files shouldn't be there, but just in case
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

LVL 85

Expert Comment

ID: 38321947
Yes, that's what /XO is for. As I said, by default robocopy will overwrite a target file with the same name if there is any difference (which means that an older source file will overwrite a newer target file); /XO will make sure that a target file will only be overwritten if the source file is newer.
LVL 29

Author Comment

ID: 38321977
Ok, sorry, I was reading too fast
LVL 29

Author Closing Comment

ID: 38321979
Thanks again!
LVL 29

Author Comment

ID: 38322397
Just in case, I also found RichCopy.  Since RoboCopy did not work on the old XP machine without downloading the Windows Server 2003 Resource Kit Tools which adds all the "extra" DOS commands as well on the Windows XP box.

Hopefully though I won't have to use any of these again

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
A quick guide on how to use Group Policy to create a custom power plan and set it active on Windows 7.
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…
This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.
Suggested Courses
Course of the Month19 days, 15 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question