DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
FREEDOM251

Freedom251 › Blog › Backup

Robocopy Commands for Copying Files, Preserving Timestamps, and Showing Progress

By Freedom251 Team · · 8 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a recursive copy that includes empty folders, preserves file and directory metadata, shows an estimated completion time, and writes a live log, use robocopy "C:Source" "D:Destination" /E /COPY:DAT /DCOPY:DAT /ETA /TEE /LOG:"C:Logsrobocopy.log" /R:2 /W:5. Replace the sample paths, create C:Logs first, and remove or change any switch you do not need. Treat /MIR separately: it can delete destination files that are absent from the source.

The practical Robocopy command

Run this from Command Prompt or a script when you want a complete directory-tree copy with metadata, visible progress, and a persistent log:

As an Amazon Associate I earn from qualifying purchases.

robocopy "C:Source" "D:Destination" /E /COPY:DAT /DCOPY:DAT /ETA /TEE /LOG:"C:Logsrobocopy.log" /R:2 /W:5
  • "C:Source" is the folder being copied.
  • "D:Destination" is the target folder. Quoting paths protects spaces and special characters.
  • /E copies all subdirectories, including empty ones.
  • /COPY:DAT requests file data, attributes, and timestamps.
  • /DCOPY:DAT requests directory data, attributes, and timestamps; directory metadata is controlled separately from file metadata.
  • /ETA displays an estimated arrival time for files being copied.
  • /TEE sends output to the console and the log at the same time.
  • /LOG:"C:Logsrobocopy.log" writes a log and overwrites an existing file with that name. The log folder must already exist.
  • /R:2 /W:5 limits each failed copy to two retries, waiting five seconds between attempts.

The command is based on Microsoft’s documented Robocopy options. Confirm the source and destination before pressing Enter, particularly when a destination contains files you cannot easily restore. The current Microsoft reference lists Windows 10 and 11 and Windows Server 2016, 2019, 2022, and 2025 among supported products; older or unusual installations should be checked with local help by running robocopy /?. See the Microsoft Robocopy reference.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How the switches affect the copy

Choose whether empty folders are included

Goal Switch Result
Reproduce the complete folder tree /E Copies subdirectories, including empty directories.
Copy only directories containing files /S Copies subdirectories but excludes empty directories.

Use /E for a backup, migration, or archive where an empty folder is part of the intended structure. Use /S when empty folders are irrelevant and you want a smaller result.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Preserve file metadata with /COPY

/COPY:DAT means:

  • D — file data (the contents).
  • A — file attributes, such as read-only or hidden.
  • T — file timestamps.

Microsoft documents DAT as Robocopy’s default file-copy setting, but writing it explicitly makes a script’s intent clear. The switch applies to files; it does not automatically request directory timestamps.

Preserve directory timestamps with /DCOPY

Directory metadata uses its own switch. Add /DCOPY:T when the folder timestamps are important, or use /DCOPY:DAT when you also want directory data and attributes requested. Microsoft’s Azure Data Box guidance specifically uses /DCOPY:DAT when a directory’s CreationTime must transfer; see Microsoft’s file ACL, attribute, and timestamp guidance.

Therefore, a command containing only /COPY:DAT can preserve file timestamps while leaving directory timestamps at their destination-side values. Include a /DCOPY timestamp flag whenever folder dates matter to your audit, migration, or archival process.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Show progress and keep useful logs

Estimated completion time

/ETA displays an estimated arrival time while files are copied. Do not combine it with /NP if you need visible progress: /NP means “no progress” and suppresses copy-progress output.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Robocopy’s estimates are operational guidance, not a guaranteed finish time. File sizes, storage speed, network congestion, antivirus scanning, and retries can change the estimate during a run.

Console plus log output

Use /TEE with a logging switch when you want to watch the run and retain a record:

robocopy "C:Source" "D:Destination" /E /COPY:DAT /DCOPY:DAT /ETA /TEE /LOG:"C:Logscopy.log"

/LOG:path overwrites an existing log at that path. To retain earlier runs and add new output, use /LOG+:path instead:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
robocopy "C:Source" "D:Destination" /E /COPY:DAT /DCOPY:DAT /ETA /TEE /LOG+:"C:Logscopy-history.log"

Create the log directory before starting, for example with mkdir C:Logs. If the directory does not exist, the logging path cannot be used as written. Choose a location that remains available for the entire operation, especially when the source or destination is a removable or network volume.

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord | 6.35mm Jack, Durable Design, Stage and Home Studio Use, Low Noise Shielded Electric Cord for Bass, Keyboard, Amp, Mixer
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Control retries instead of accepting Robocopy’s defaults

Robocopy’s documented defaults are extremely persistent: up to 1,000,000 retries with a 30-second wait between retries. A disconnected drive or locked file can consequently keep a command running for a very long time. Set both values explicitly:

Switch Meaning Example
/R:n Number of retries for a failed copy. /R:2 tries twice after the initial attempt.
/W:n Seconds to wait between retries. /W:5 waits five seconds.

For a local copy where a quick failure is preferable, small values such as /R:1 /W:2 are easier to monitor. For a flaky network connection, increase them deliberately and account for the resulting run time. The right values depend on whether a transient interruption or a prompt error is more costly.

Resume interrupted files and use parallel threads

Restartable mode

/Z enables restartable mode. If a transfer is interrupted, Robocopy can resume the file rather than necessarily starting that file from the beginning. This is useful for large files and unstable connections, although restartable mode can add overhead on some workloads.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
robocopy "C:Source" "D:Destination" /E /COPY:DAT /DCOPY:DAT /Z /ETA /R:2 /W:5

Multithreaded copying

/MT:n copies using multiple threads. Microsoft documents values from 1 through 128 and a default of 8 when multithreading is enabled. More threads are not automatically faster: a single disk, a busy network, small files, encryption, or endpoint scanning can become the bottleneck. Start with a conservative value, observe the workload, and raise it only when the storage and network can sustain the additional concurrency.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
robocopy "C:Source" "D:Destination" /E /COPY:DAT /DCOPY:DAT /MT:16 /ETA /TEE /LOG:"C:Logscopy.log" /R:2 /W:5

When troubleshooting a slow or inconsistent copy, temporarily omit /MT or use a low value so that the failure pattern is easier to interpret.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Understand the danger of /MIR

/MIR mirrors the source tree and can delete destination items that do not exist in the source. It is effectively a combination of copying the complete tree and purging destination-only content. /PURGE also removes destination items absent from the source. Neither switch should be added merely because you want a recursive copy.

Folder-level mistakes are especially serious. If the source is one directory level higher or lower than intended, Robocopy can delete large numbers of destination files and then copy a different tree into place. Microsoft calls out this path-matching risk in its Azure Files migration guidance.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Preview a mirror safely

Add /L to list planned actions without copying, deleting, or changing timestamps:

robocopy "C:Source" "D:Destination" /MIR /L /TEE /LOG:"C:Logsmirror-preview.log"
  1. Check the complete source and destination paths, including drive letters, share names, and trailing folder levels.
  2. Create the log directory and run the listing command with /L.
  3. Read the preview for files marked for deletion and for unexpected source or destination folders.
  4. Back up or otherwise preserve destination-only data that should remain.
  5. Remove /L only when the deletions and resulting tree are intentional.

A preview is a safety check, not a backup. It reports what Robocopy plans based on the paths and options you supplied; it does not protect you from choosing the wrong volumes.

Ready-to-use command patterns

Use case Command Important behavior
Complete copy with empty folders, file and directory timestamps, and ETA robocopy "C:Source" "D:Destination" /E /COPY:DAT /DCOPY:DAT /ETA Copies the tree without mirroring or deletion.
Copy while displaying output and saving a new log robocopy "C:Source" "D:Destination" /E /COPY:DAT /DCOPY:DAT /ETA /TEE /LOG:"C:Logscopy.log" Console output is duplicated to a log; an existing log with that name is overwritten.
Append to a historical log robocopy "C:Source" "D:Destination" /E /COPY:DAT /DCOPY:DAT /ETA /TEE /LOG+:"C:Logscopy-history.log" New output is added to the existing file.
Preview a potentially destructive mirror robocopy "C:Source" "D:Destination" /MIR /L /TEE /LOG:"C:Logspreview.log" Lists planned changes only; no copy or deletion occurs while /L is present.
Resume interrupted transfers robocopy "C:Source" "D:Destination" /E /COPY:DAT /DCOPY:DAT /Z /ETA /R:2 /W:5 Uses restartable mode and bounded retries.

A safe workflow for a real copy

  1. Identify the exact roots. Decide whether the source root itself or only its contents should appear beneath the destination. Robocopy’s result depends on the two folder paths you provide.
  2. Check access. Confirm that your account can read the source and create or modify files at the destination. Network shares may require credentials or a mapped path that is available in the current session.
  3. Create the log folder. Run mkdir C:Logs or select an existing writable folder.
  4. Select scope. Use /E for empty directories or /S to omit them. Add /COPY:DAT and the appropriate /DCOPY option when metadata matters.
  5. Bound failure behavior. Set /R and /W; add /Z for interruption-prone transfers.
  6. Run with observation. Add /ETA for progress and /TEE plus /LOG for a record.
  7. Use a preview before deletion. If /MIR or /PURGE is present, run the same command with /L first and inspect every proposed deletion.
  8. Validate the result. Check representative files, timestamps, attributes, empty folders, and the log. For a migration, compare important counts and sizes using your normal operational checks rather than assuming a successful-looking progress display proves every file is usable.

Common problems and fixes

The command appears stuck

First check whether Robocopy is waiting on its retry policy. The default retry count and delay are very high, so explicitly adding /R and /W makes failures finite and visible. A disconnected source, locked file, permissions problem, or unavailable network share can all trigger retries.

Progress is missing

Remove /NP if it is present. Keep /ETA for estimated completion information, and remember that /TEE affects where output is sent, not whether progress is generated.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

File dates are correct but folder dates are not

/COPY:DAT covers file metadata. Add /DCOPY:T or /DCOPY:DAT because directory timestamps use an independent option.

The log is missing or unexpectedly short

Verify that the parent directory exists and is writable. Also check whether you used /LOG, which overwrites, when you intended /LOG+, which appends.

Destination files disappeared

Inspect whether /MIR or /PURGE was used. Those options intentionally remove destination-only items. Restore from a backup if the deletion was unintended, then repeat with correctly matched paths and a listing-only /L preview.

Which command should you choose?

  • For an ordinary, non-destructive recursive copy, start with /E /COPY:DAT /DCOPY:DAT.
  • Add /ETA when you need visible estimated progress.
  • Add /TEE /LOG:path when another person or a later audit needs the console output.
  • Add /R:n /W:n to prevent a bad connection from producing an effectively endless run.
  • Add /Z for large or interruption-prone transfers.
  • Add /MT:n only after considering the limits of the disks, network, and workload.
  • Use /MIR only when destination cleanup is part of the requirement, and preview it with /L first.

For the option definitions and syntax, consult Microsoft’s Robocopy command documentation. The Azure migration example and its path warning are documented at Microsoft Azure Files migration with Robocopy.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

BackupCommand PromptFile CopyingmigrationROBOCOPYtimestampsWindows

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.