run robocopy bat to copy entire drive to another drive

with "D:" you are not specifying the root directory of the D drive (D:\) but the current directory of D instead, (D:\temp in your example).

To solve this problem, just add \ to the source spec (and while there, to the dest spec as well)

robocopy d:\ k:\ /L /v                 

/L options make a dry run, nothing actually copied.

From MS website: /l Specifies that files are to be listed only (and not copied, deleted, or time stamped).

here is sample of my test dry run before copying and entire disk:

      Total    Copied   Skipped  Mismatch    FAILED    Extras                                                                                                                                                                                                             Dirs :     63346     63346         2         0         0         0                                                                                                                                                                                                            Files :    719564    719564         0         0         0         0                                                                                                                                                                                                            Bytes :   4.039 t   4.039 t         0         0         0         0                                                                                                                                                                                                            Times :   0:27:58   0:00:00                       0:00:00   0:27:57                                                                                                                                                                                                            Ended : Monday, September 6, 2021 9:25:35 AM  

and here is my Notepad for making my command, (notice I simply remove the /L to actually copy):

for testing (dry run): robocopy Q: G: /L /E /COPYALL /R:20 /W:15 /MT /NP /A-:SH /Z /V /TEE /LOG+:VMRobCp.log

Real run: robocopy Q: G: /E /COPYALL /R:20 /W:15 /MT /NP /A-:SH /Z /V /TEE /LOG+:VMRobCp.log


Use the /E Option. Also check other necessary/useful params like /copyall /ZB or /DCOPY:DAT via /?.