Windows 11 Mirror copying files between USB drives

D4zza

Member
Joined
Dec 20, 2025
Messages
2
Hi. I’m wondering how to achieve mirroring a USB hard drive to an other USB hard drive.

So, I run a batch file, or a free application, to copy files from USB drive D to USB drive E. If I create or change a file on D, then once I perform the file copy, drive E is updated. However, I also want the setup that if I delete a file from D then the file copy will delete from E.

I have a robocopy batch file that incrementally copies but doesn’t delete files from E if I delete from D. Am I actually able to run Robocopy with a switch setting to also delete?

I should also say I don’t want E to be a backup zip file or anything like a backup application would create, I want E to be accessible in the same way as any windows drive file system.

Many help appreciated please. Thanks.
 

Solution
Hi D4zza — yes, Robocopy can do exactly that. Use the /MIR (mirror) or the /PURGE switch to make the destination match the source (including deleting files in E that were deleted from D). A few important cautions and a safe example follow.
Short summary
  • /MIR = mirror trees (same as /E plus /PURGE) — it will remove files/dirs in destination that don't exist in source.
  • /PURGE deletes files/dirs in destination that are not in source (use with /E if you want empty dirs preserved).
  • Always test first with /L (list-only) so you can see what would be changed without actually changing anything.
Quick preview (no changes)
robocopy "D:\" "E:\" /MIR /L /NJH /NJS /NDL /NP
Real run (example)
robocopy "D:\" "E:\" /MIR /Z /R:2 /W:5...
Hi D4zza — yes, Robocopy can do exactly that. Use the /MIR (mirror) or the /PURGE switch to make the destination match the source (including deleting files in E that were deleted from D). A few important cautions and a safe example follow.
Short summary
  • /MIR = mirror trees (same as /E plus /PURGE) — it will remove files/dirs in destination that don't exist in source.
  • /PURGE deletes files/dirs in destination that are not in source (use with /E if you want empty dirs preserved).
  • Always test first with /L (list-only) so you can see what would be changed without actually changing anything.
Quick preview (no changes)
robocopy "D:\" "E:\" /MIR /L /NJH /NJS /NDL /NP
Real run (example)
robocopy "D:\" "E:\" /MIR /Z /R:2 /W:5 /MT:8 /V /NP /LOG:"%USERPROFILE%\robocopy_mirror.log"
What those switches do (most useful ones)
  • /MIR — mirror source to destination (will delete extra files on destination).
  • /PURGE — delete destination files and directories that no longer exist in source (alternative to /MIR when you want control).
  • /E — copy subdirectories, including empty ones (if you use /PURGE you typically add /E).
  • /Z — restartable mode (good for USB disconnects).
  • /R:n and /W:n — retry count and wait seconds (avoid long hangs on bad files).
  • /MT:n — multi-threaded copy (faster; default n=8, up to 128).
  • /L — list-only (very useful to preview what will happen).
  • /LOG:filename and /TEE — record output to a log and print to console.
  • /NP — no progress (reduces console spam).
  • /V — verbose.
Safety tips (very important)
  1. Run with /L first — always check what Robocopy would delete before you run it for real.
  2. Be careful with drive letters: if D: or E: change (you plug other drives in) the script could wipe the wrong disk. Add a check for volume label or prompt for confirmation before running.
  3. Keep a recent backup (or test on a small folder first). /MIR will permanently delete files on the destination if they no longer exist on the source.
  4. If you want file ACLs and attributes copied, use /COPYALL or /SEC as needed.
Safe batch example that asks for confirmation by volume label
Save this as MirrorDtoE.bat and edit labels to match your drives.
@echo off
set "SRC=D:"
set "DST=E:"
for /f "tokens=2 delims==" %%a in ('wmic logicaldisk where "DeviceID='%SRC%'" get VolumeName /value ^| find "="') do set "SRC_LABEL=%%a"
for /f "tokens=2 delims==" %%a in ('wmic logicaldisk where "DeviceID='%DST%'" get VolumeName /value ^| find "="') do set "DST_LABEL=%%a"
echo Source: %SRC% Label: "%SRC_LABEL%"
echo Dest: %DST% Label: "%DST_LABEL%"
set /p "CONF=Proceed with mirror from %SRC% to %DST% (type Y to continue)? "
if /i not "%CONF%"=="Y" goto :eof
robocopy "%SRC%\" "%DST%\" /MIR /Z /R:2 /W:5 /MT:8 /V /NP /LOG:"%~dp0robocopy_mirror.log" /TEE
pause
Other options (GUI/free)
  • FreeFileSync — free GUI tool with a “Mirror” mode that deletes destination entries to match the source. It’s easier to preview and has a realtime option (and you still get a normal filesystem on the destination).
  • SyncToy (legacy) /rsync ports for Windows — also options, but Robocopy + /MIR is native and reliable.
If you want, I can:
  • Give a one-line test you can paste into a command prompt to preview the exact deletes, or
  • Produce a finished safe .bat that checks labels and logs output for you (tell me your source and destination drive letters and their volume labels if you want the label-check script).
Which would you prefer?
 

Solution
You’re welcome, D4zza — glad it helped.
If you’d like, I can:
  • Provide the finished, safe .bat (with volume-label checks and logging) you can drop in and run, or
  • Give a one-line preview command you can paste in to see what Robocopy would delete (no changes), or
  • Walk you through setting up FreeFileSync if you prefer a GUI.
Which would you like me to do?
 

Hi. I’m wondering how to achieve mirroring a USB hard drive to an other USB hard drive.

So, I run a batch file, or a free application, to copy files from USB drive D to USB drive E. If I create or change a file on D, then once I perform the file copy, drive E is updated. However, I also want the setup that if I delete a file from D then the file copy will delete from E.

I have a robocopy batch file that incrementally copies but doesn’t delete files from E if I delete from D. Am I actually able to run Robocopy with a switch setting to also delete?

I should also say I don’t want E to be a backup zip file or anything like a backup application would create, I want E to be accessible in the same way as any windows drive file system.

Many help appreciated please. Thanks.
Yes, Robocopy already does exactly what you want and the missing piece is the /MIR switch. It mirrors D to E including deletions so when a file disappears from D it will also be removed from E on the next run. Just be aware that /MIR is powerful and unforgiving so if you accidentally delete something on D it’s gone from E too. A safer real world approach is to test first with /L which shows what would be deleted without actually doing it. Once you’re comfortable remove /L and you’ll have two USB drives that stay identical and fully browsable like normal Windows drives.
 

Back
Top