1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Right command for Robocopy.

Discussion in 'Windows 7' started by dbguru16, Jun 20, 2012.

Thread Status:
Not open for further replies.
Advertisement
  1. dbguru16

    dbguru16 Thread Starter

    Joined:
    Apr 20, 2005
    Messages:
    93
    Hi,
    I've been wanting to transfer my files from an old HDD to a new one exactly as they are, with the time stamps the way they are currently on the old HDD and all, and I heard that using Robocopy via the command prompt can help me do that. However, I don't want to delete everything on the old HDD. I've been looking around the internet, and anything I can find is just confusing to me.

    The old external HDD that has all my files and folders is J: and the HDD I want to transfer them to which is a new internal HDD is Z:

    What would be the proper command for copying everything on J: exactly as it is to Z: ? I hope I put this question in the correct section, lol, and as always, thanks for everyones help.
    - Guru
    - Windows 7 Home Premium 64x, 16gb ram, 4.20GHz AMD FX quad-core cpu,
     
  2. mhd1360

    mhd1360

    Joined:
    May 28, 2012
    Messages:
    416
    You can use this command
    It will copy All files and folders with theirs attributes and timestamps from J: to Z:
    Code:
     robocopy [COLOR=Red]J:[/COLOR] [COLOR=Blue]Z:[/COLOR] /dcopy:T /copy:DATSOU /E 
    Details :

    if you want you can make a directory on drive Z named "OldDriveFiles" and then copy whole data from J to that :
    Code:
    md [COLOR=Blue]z:\olddrivefiles[/COLOR]
    robocopy [COLOR=Red]J:[/COLOR] [COLOR=Blue]Z:\olddrivefiles[/COLOR] /dcopy:T /copy:DATSOU /E
    
    

    /DCOPY:T ==> COPY Directory Timestamps.

    /copy DATSOU ==>D=Data, A=Attributes, T=Timestamps S=Security=NTFS ACLs, O=Owner info, U=aUditing info).

    /E ==> copy subdirectories, including Empty ones.


    You can remove which one of "DATSOU" if you want.
     
  3. dbguru16

    dbguru16 Thread Starter

    Joined:
    Apr 20, 2005
    Messages:
    93
    AWESOME! You told me exactly what I needed to know and what it meant, appreciate it so much. :) I get how it works now and will definitely be giving it a try as soon as I get home from work. Thanks a bunch. =D
     
  4. mhd1360

    mhd1360

    Joined:
    May 28, 2012
    Messages:
    416
    Your welcome dude ;)
     
  5. dbguru16

    dbguru16 Thread Starter

    Joined:
    Apr 20, 2005
    Messages:
    93
    Is it ok to not use the /copy: DATSOU ? I got the error that I don't have the Manage Auditing user right and that I need that to copy auditing information (I dunno what auditing information is anyway, lol. Is it important?).
     
  6. mhd1360

    mhd1360

    Joined:
    May 28, 2012
    Messages:
    416
    Yes, You can ignore "U" and use /copy: DATSO
     
  7. bbearren

    bbearren

    Joined:
    Jul 14, 2006
    Messages:
    3,775
    I would use

    J:\ Z:\ /E /COPYALL /XJ

    /E copies folders recursively, including empty folders. /COPYALL copies all file information/attributes. /XJ excludes Junction points.
     
  8. dbguru16

    dbguru16 Thread Starter

    Joined:
    Apr 20, 2005
    Messages:
    93
    That's so confusing, lol. What do you mean by recursively and what are Junction points? (Isn't very pro or leet at this stuff, lol.) Just got home and just finished running anti-virus on the hdd, so I'm ready to go.
     
  9. mhd1360

    mhd1360

    Joined:
    May 28, 2012
    Messages:
    416
    /COPYALL <=> /copy: DATSOU
     
  10. dbguru16

    dbguru16 Thread Starter

    Joined:
    Apr 20, 2005
    Messages:
    93
    Ah, ok. Thanks. :)
     
  11. mhd1360

    mhd1360

    Joined:
    May 28, 2012
    Messages:
    416
    Both commands will work
    No Problem
     
  12. dbguru16

    dbguru16 Thread Starter

    Joined:
    Apr 20, 2005
    Messages:
    93
    It seems the only thing I can get copied is a .avi file that is not in a folder in J:
    After that all I get is :

    2012/06/26 22:56:28 ERROR 5 <0x00000005> Accessing Destination Directory Z:\$RECYCLE.BIN\
    Access is denied.
    Waiting 30 seconds...

    That repeats... Not sure why, there's not a recycle bin on either drive, their just storage drives, lol.
    Also, still get the ERROR about not having the Manage Auditing user right with the second way of copying everything that bbearren suggested.
     
  13. bbearren

    bbearren

    Joined:
    Jul 14, 2006
    Messages:
    3,775
    Are you using an elevated command prompt? And there is a Recycle bin on every drive, even if you have designated no Recycle bin for the drive. Windows puts an empty Recycle bin there regardless.
     
  14. dbguru16

    dbguru16 Thread Starter

    Joined:
    Apr 20, 2005
    Messages:
    93
    I'm using the Command Prompt under Start>All Programs>Accessories. Is there a different one in Windows I should be using for this task?
     
  15. Megabite

    Megabite

    Joined:
    Apr 5, 2008
    Messages:
    11,761
    No, just right click on the command Prompt Icon and "Run as Admin"
     
  16. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1057912