Technical Anshu
Tutorials Blog
💽 Backup First

Back Up User Files Before Repair with a Robocopy Script

Rule one of professional repair — data first, repair second. Robocopy, already inside every Windows, copies a full user profile reliably where drag-and-drop fails.

✍️ Technical Anshu🪟 Windows 10 / 11⏱️ 6 minute read
🎥 Watch the full video — CMD Toolkit V3 GUI, portable software and 5000+ commands shown step by step

Ask a technician what separates them from an amateur and the answer is not speed — it is that they back up before they touch anything. Windows may be reinstalled in an hour; a family's photos cannot. Explorer copy-paste is a poor backup tool: it stops at the first locked or long-path file and tells you nothing afterwards. Robocopy is the professional answer — resumable, logged, and already built into Windows. This guide gives you one clean script you can save in your portable toolkit and reuse on every job.

The script at work (recreated panel)
C:\>robocopy "C:\Users\Rahul" "E:\Backup\Rahul" /E /COPY:DAT /R:1 /W:1 /XJ /LOG:E:\Backup\robocopy-log.txt Total Copied Skipped Mismatch FAILED Extras Dirs : 214 212 2 0 0 0 Files: 8931 8904 27 0 0 0 Ended : backup complete — FAILED column is 0
👆 The summary table is the point — you can prove the backup is complete, not hope it is (panel recreated with real robocopy output format)
1

The One Command, Explained Switch by Switch

Open Command Prompt and adapt this line — source is the user's profile folder, destination is a folder on your external drive:

  1. robocopy "C:\Users\Username" "E:\Backup\Username" /E /COPY:DAT /R:1 /W:1 /XJ /LOG:E:\Backup\log.txt
  2. /E copies all subfolders including empty ones, so the folder structure survives
  3. /COPY:DAT keeps file data, attributes and timestamps — the defaults that matter
  4. /R:1 /W:1 retries a locked file once after one second instead of robocopy's factory default of a million retries, which can stall a job for hours
  5. /XJ skips junction points, avoiding the endless loops that profile folders are famous for
2

The Switch You Must Not Use for Backup

Robocopy has a mirror switch, /MIR, and it is the most dangerous word in this guide. Mirroring makes the destination identical to the source — including deleting destination files that no longer exist in the source. Point a mirror at the wrong folder pair and your backup deletes itself. For pre-repair backup, plain /E copies without deleting anything, ever. Mirror mode has legitimate uses in scheduled backup systems; a technician's rescue copy is not one of them.

3

Read the Result Like a Professional

When robocopy finishes, the summary is your report:

  1. The FAILED column should be 0 — anything else, open the log and find which files failed and why
  2. Robocopy exit codes need decoding: codes 0 to 7 all mean success in various forms (nothing to copy, files copied, extra files noticed); 8 and above means real failures
  3. Skipped files are usually locked databases or files in use — note them and tell the owner, do not hide them
4

Turn It into a Reusable Toolkit Script

Save the command as a batch file inside your portable toolkit folder:

  1. Paste the command into Notepad with the source and destination left clearly marked for editing, and save it as backup-profile.bat
  2. On each job you edit only the two paths and the username, run it, and read the log
  3. Keep the pen drive copy read-only in your head: this script is yours — never run a stranger's backup script on a customer's PC

With the data safe, every repair after this point becomes calm — including the ones in the full video, where the toolkit workflow continues from exactly this step.

🎥 See CMD Toolkit V3 Working in the Full Video

The complete walkthrough — GUI interface, portable software and the command library, shown live on a real PC.

▶️ Watch Full Video
❓ Frequently Asked Questions

Why not just copy the folders with the mouse

Because Explorer gives up silently. One locked file stops or corrupts the whole queue, long paths fail without clear messages, and there is no record of what actually copied. Robocopy retries sensibly, skips junctions that cause loops, completes the job and writes a log you can check line by line.

Does robocopy copy files that are open or locked

It tries, with the retry limits you set, but a file locked by a running program may still fail — that is what the FAILED column and the log are for. For a profile backup, closing the user's programs first, or copying after booting into another environment, clears almost every lock.

How big a drive do I need for a profile backup

At least as big as the data inside the profile — check the profile folder's size in its Properties first. Photos and videos dominate most profiles. A 128 GB or larger external drive covers most home users, and the log tells you exactly how much was copied.

This guide is based on the Technical Anshu CMD Toolkit V3 video • Stuck on a step? Ask in the video comments — you will get a reply 🙏