How-to guides · Windows 11

Copy a large folder over an unreliable LAN with restartable Robocopy and a log

Preview and run a restartable Robocopy job with bounded retries, a log and post-copy verification. Compare the observed outcomes to choose the next investigation and preserve the original configuration.

Published · Updated · FaultNote editorial policy

Copy a large folder over an unreliable LAN with restartable Robocopy and a log overview: Fix the source and destination, Preview the exact job first, Understand restart and retry options, Avoid deletion options for this task, Read the exit code and log, Verify the destination before cleanup, Worked example: interruption versus access denial, Conditions for an unattended transfer
An overview of this guide’s steps and checks, not a screenshot of the app.

Who this guide is for and what to prepare

  • Users transferring a large folder over a LAN and checking partial failure

What you need

  • Save work and record the time and destination of the symptom
  • Record the PC and router models and Windows version

Fix the source and destination

Save and close files still being edited and retain the source. Check write access and available space on the destination share, then use a dedicated empty folder. Keeping this a copy operation leaves the source available for verification.

Preview the exact job first

Replace the example paths. Run the first line separately: /L lists the planned operation without copying. Check source direction and the expected files before running the second line, which performs the job and writes a log.

PowerShell
robocopy "C:\Transfer" "\\HOME-PC\Incoming\Trial" /E /Z /R:2 /W:5 /L
robocopy "C:\Transfer" "\\HOME-PC\Incoming\Trial" /E /Z /R:2 /W:5 /LOG:"$env:USERPROFILE\Desktop\copy-log.txt"

Understand restart and retry options

The example includes subfolders with /E, restartable mode with /Z, and two retries separated by five seconds. Restartable copying does not repair the connection. Once connectivity returns, rerun the same job and inspect its log.

  1. Replace paths, retain quotes and preview a small representative folder. Verify source direction from the selected files.
  2. Save and close source editors, choose a writable log path and run the copying command separately after preview.
  3. Read $LASTEXITCODE immediately. For eight or higher inspect failures, preserve the previous log and fix the underlying cause before retrying.
  4. Open important recipient files while retaining originals. Treat source deletion or moving as a separate post-verification task.

Avoid deletion options for this task

Do not add /MIR, /PURGE or /MOVE to this transfer: they introduce deletion or source removal. That changes the preservation assumptions of an initial migration. When destination names already exist, inspect overwrite behavior during preview.

Read the exit code and log

Immediately inspect $LASTEXITCODE in PowerShell. Robocopy does not reserve all successful outcomes for zero; eight or higher indicates at least one copy failure. Also inspect failed, skipped and total counts, distinguishing access denial from disconnection.

The example uses the same log filename, so preserve a previous run under another name before a comparison. Logs can contain private filenames, paths and error details. For support, extract the failed entries and necessary nearby context rather than publishing the complete directory inventory.

Verify the destination before cleanup

Open representative large and small destination files and compare hashes for important files when needed. Retain the log and source until ordinary applications can use the copied data. The example does not guarantee completion time or speed.

Scroll horizontally to see the full table →

Verify the destination before cleanup
ObservationNext action
Exit code eight or higherIdentify at least one failed copy in the log and address its cause.
Below eight with no failed filesInspect skipped or mismatched files and open important recipient files.
Rerun progresses after reconnectingKeep the same paths and preserve source and previous logs.

Worked example: interruption versus access denial

If the same file fails with a connection error and succeeds after reconnecting, prioritize connection stability. Repeated access denial at the same location instead suggests permissions or an application holding a file. Raising retries alone fixes neither cause; read the failed entry.

Do not delete the source after partial success. Matching file counts cannot establish the contents of failed or actively changing files. Open important documents on the recipient and inspect representative photos or video segments using the applications that will use them.

Conditions for an unattended transfer

For a long transfer, check sleep behavior on both PCs, AC power and destination capacity. Record temporary power-setting changes and restore them afterward. An overnight run is not automatically successful; inspect the final log and outcome the next morning.

If considering an archive for many files, account for extraction space and the size of a failed retry. Many small files and one large file create different workloads. Test representative data first in either case and retain originals before running the full migration.

Limitations and requirements

  • These procedures target home PCs; follow administrator policy on managed devices.

Frequently asked questions

Does every rerun copy everything again?

Existing file state and options affect selection. Keep the same paths, inspect a preview when needed and read the resulting log.

Is exit code one a failure?

Robocopy uses nonzero codes for outcomes including copied files. Interpret the eight-or-higher failure threshold alongside the log.

Will this log append to the previous run?

The example /LOG writes the specified file. Preserve old runs separately; consult /LOG+ documentation when intentional appending is needed.

Sources and verification date

Sources checked: . These sources support the specifications, procedures or prices discussed here. Check each source for applicable conditions and current information.

Related practical guides

Windows 11 troubleshooting

How-to guides: browse all guides →