Last Updated on 2014-05-21.
Scenario
For important data in your local network, you should use professional backup products like from Acronis etc.
But there might be some stations in your network which are not worth to buy a separate backup license for them – like e.g. the OS drive of your backup destination where barely anything changes. On the other hand, it would also be time-consuming to re-configure it in case the drive crashes someday.
Solution
Windows 7 offered a GUI to do simple 1:1 backups, Windows 8 upwards does not provide this feature any more – but as console command, it still works.
With the following script, you can make sure you have exactly 1 copy of your system drive. It assumes you have a second hard drive D:.
To use the script, copy it into a batch file and e.g. create a scheduled task for it, e.g. weekly.
echo "Script for running local backup of system partitions" echo "Target D: -> D:WindowsImageBackup is created automatically" rd /s /q d:WindowsImageBackup wbAdmin start backup -backupTarget:D: -include:C: -allCritical -quiet
Restoring can be done e.g. booting from your Windows DVD, you can access the image(s) under Setup -> Advanced Repair Options.