Situatie
You can back up important folders automatically using only tools built into Windows, with no third-party software.
Requirements: Windows 10/11, a second drive or network share to store the backup.
Solutie
- Create the destination folder, for example
D:\Backup\Documents. - Open Command Prompt and test the backup manually first:
robocopy "C:\Users\%USERNAME%\Documents" "D:\Backup\Documents" /MIR /R:2 /W:5 /LOG+:"D:\Backup\backup.log"
- Check
backup.log. A robocopy exit code between 0 and 7 means success; 8 or higher means at least one error. - Press the Windows key, type
Task Schedulerand open it. - In the right panel, click Create Basic Task, name it
Daily Documents Backupand click Next. - Choose Daily, set a time when the PC is on (for example 20:00) and click Next.
- Select Start a program and click Next.
- In Program/script enter
robocopy. In Add arguments paste:
"C:\Users\YourUser\Documents" "D:\Backup\Documents" /MIR /R:2 /W:5 /LOG+:"D:\Backup\backup.log"
(replace YourUser with your actual username; environment variables are not always expanded here)
- Click Finish, right-click the new task and select Run to test it.
Warning: /MIR mirrors the source exactly, so files deleted from the source are also deleted from the backup. If you want to keep deleted files, use /E instead of /MIR.
Leave A Comment?