?
Solved

RoboCopy syntax help needed

Posted on 2013-10-31
7
Medium Priority
?
874 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 900 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 900 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

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 900 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

Introducing Priority Question

Increase expert visibility of your issues by participating in Priority Question, our latest feature for Premium and Team Account holders. Adjust the priority of your question to get emergent issues in front of subject-matter experts for help when you need it most.

Question has a verified solution.

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

By default the complete memory dump option is disabled in windows . If we want to enable the complete memory dump for a diagnostic purpose, we have a solution for it. here we are using the registry method to enable this.
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 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.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month14 days, 18 hours left to enroll

771 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