Solved

RoboCopy syntax help needed

Posted on 2013-10-31
7
829 Views
Last Modified: 2013-11-15
Hi experts,

I have a list of files that I need to copy from various locations on a windows network into one folder on another windows file server.

I need to retain the file owner, create date and modify date.

Based on my research and google searches, RoboCopy is the most suitable tool for the job.

However, I cannot get it to retain the create date.  I'm using the following command:

RoboCopy /"\source location\/" /"\destintion location\/" "file name" /copy:DATO /dcopy:T /ts /fp /r:0 /tee /log:C:\testlog.txt

Based on my research, the parameter "/copy:DATO" should allow me to retain all dates but it's not working.  Please help me correct this.

My 2nd question is:  if there are two files with the same name in the source locations which I'm now trying to copy into the same destination folder, how will roboCopy handle that?  Do I have options available to prompt, ore replace, or skip or rename?

I'm running the command on a Windows 7 machine.

Many thanks
0
Comment
Question by:PantoffelSlippers
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 18

Accepted Solution

by:
Steven Harris earned 300 total points
ID: 39614980
copy:DATO is to retain Owner info.

use /COPYALL to retain all info.
0
 

Author Comment

by:PantoffelSlippers
ID: 39614989
Is the "T" in DATO not for timestamps?
0
 
LVL 18

Assisted Solution

by:Steven Harris
Steven Harris earned 300 total points
ID: 39614996
It is, but you also have other switches that are interfering.

Try the following:

RoboCopy "source" "destination" "file name" /COPYALL /XO /TS /FP /R:0 /TEE /LOG:C:\testlog.txt

Open in new window



/XO answers the second question:

/XO : eXclude Older - if destination file exists and is the same date or newer than the source - don’t bother to overwrite it.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:PantoffelSlippers
ID: 39615946
Thank you,

Is XO the only option available in terms duplicate names in the destination folder?

I know that there are files that have the same name but the content is not necessarily the same.  Is there a way to retain both copies in the destination directory?

Thanks again
0
 

Author Comment

by:PantoffelSlippers
ID: 39615964
What does this switch do?

/is
Includes the same files.
0
 
LVL 18

Assisted Solution

by:Steven Harris
Steven Harris earned 300 total points
ID: 39616636
Is XO the only option available in terms duplicate names in the destination folder?
Not exactly sure what you mean by this one, but there is also /XC, /XN, /XL ...

I know that there are files that have the same name but the content is not necessarily the same.  Is there a way to retain both copies in the destination directory?

What is the final outcome you are looking to obtain?  Merging all files from multiple sources into a single folder?  Are you wanting to keep the same folder structures?

What does this switch do?

/is
Includes the same files.

/IS : Include Same, overwrite files even if they are already the same.

You do not want the /IS switch.
0
 

Author Closing Comment

by:PantoffelSlippers
ID: 39651841
My original script actually worked - I needed to refresh the destination folder before seeing the retained time stamps.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
OfficeMate Freezes on login or does not load after login credentials are input.
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
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…

740 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