Solved

RoboCopy syntax help needed

Posted on 2013-10-31
7
742 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
  • 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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I found out last night windows update has a problem regarding 4 latest updates that fail.  The way to get all 4 them installed is install sp1 first and restart then one by one with a resart in between as they fail every time if all the four updates …
I recently purchased an HP EliteBook 2540p notebook/laptop. It has two video ports on it – VGA and DisplayPort. HP offers an optional docking station for the 2540p that also has both a VGA port and a DisplayPort. There are numerous online reports do…
This Micro Tutorial will give you basic overview of the control panel section on Windows 7. It will depth in Network and Internet, Hardware and Sound, etc. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

705 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now