Robocopy Job Template
A safer starting point for repeatable Windows file copy jobs with logging and dry-run review.
Good For
file share migration
scheduled copy jobs
backup staging
large folder moves
How to Use It
Run with `/L` first so Robocopy lists what it would copy without changing files.
Review source, destination, exclusions, retry count, and log path.
Avoid `/MIR` until you have explicitly accepted delete behavior.
Run the real copy with logging enabled.
Review Robocopy exit codes instead of treating every nonzero code as failure.
Execution Modes
- local
Inputs and Outputs
Inputs
- source path
- destination path
- exclusions
- log path
Outputs
- verbose-console
- log-file
Command Starter
Read-only command: verify target and scope
# Minimal Robocopy quick-start template. $Source = 'C:\Source' $Destination = '\\server\share' $PreviewLog = 'C:\Temp\robocopy-preview.log' $RunLog = 'C:\Temp\robocopy-run.log' # Dry-run preview. /L lists work only and does not copy or delete.
Manual or UI step
& robocopy $Source $Destination /E /L /R:2 /W:5 /TEE /LOG:$PreviewLog
Configuration or code example: review values for your environment
# Approved copy execution. This changes the destination path.
Manual or UI step
& robocopy $Source $Destination /E /R:2 /W:5 /COPY:DAT /DCOPY:DAT /TEE /LOG:$RunLog
$LASTEXITCODE
Validation
Preview log matches the intended copy scope.
Run log shows acceptable exit code and copied/skipped counts.
Destination permissions and sample files open correctly.
Reporting
Use this as the minimal template when you need a preview plus one approved copy run.
Use the richer Robocopy job template and log parser page when you need evidence parsing and migration reporting.
Safety Notes
The template is supporting material, not the production cutover decision workflow. Preview with /L first; a real Robocopy execution writes destination data and must use the migration evidence pack for validation and rollback decisions.
Preview with `/L` before copying.
Avoid `/MIR` until delete behavior is explicitly approved.
