[Windows] Incremental backup of data with .BAT (Batch)

Loss of data is a big issue associated with formatting your computer. The Windows operating system comes with backup and recovery solutions which can prevent this unexpected problem. For this problem, one can use incremental back up to save important data in the computer before formatting. The Backup Utility of Windows' operating system supports this type of Incremental back up which saves all files that have changed since the last back up, and prevents data loss. One can launch this file to copy data from the C to D drive by saving the file extension name as .bat.



Windows] Incremental backup of data with .BAT (Batch)



Use of incremental back up


Incremental back up can be used to save your important data before you format your computer.
  • During the first batch launch, all the files and folders are saved and when relaunched after 2-3 weeks, all the changes made are saved
  • In the example below the files are copied from the root C to the backup folder on the partition D
    • "% USERPROFILE%" is the variable of "Documents and Settings \ username". The switches: "E / H / R / Y / I / D", are used to copy the system 's hidden files.


For more information, open the command prompt (cmd.exe) and type xcopy/?

Example

  • First, open the notepad and copy:

@echo off        
xcopy C:\Docs D:\Backup\Docs /E /H /R /Y /I /D        
xcopy "%USERPROFILE%"\Favoris D:\Backup\Favoris /E /H /R /Y /I /D        
pause
  • Then click on "File > Save as", name the file extension as name.bat (the name is optional) and select file type as all files
  • Launch the file to copy the data from C to D



Note: Depending on your needs, you can change the letters of drives in the script
Published by deri58 - Last update on February 2, 2012 12:40 PM by Virginia Parsons
This document entitled « [Windows] Incremental backup of data with .BAT (Batch) » from Kioskea.net (en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the licence, as this note appears clearly.
Suggestions
  •  [Windows] Incremental backup of data with .BAT (Batch)
  •  Incremental backup of data with .BAT (Batch) » Tips : Incremental backup of data with .BAT (Batch) Use of incremental back up Example Use of incremental back up Incremental back up can be used to save your important data before you format your computer. During the first batch launch,...
  •  2nd SATA Hard Drive not shown on my computer (Solved) » Best answer: You need to format the drive before you can use it for data. Right-Click on the My Computer icon either on your desktop or in the Start Menu and select Manage. A new window titled Computer Management comes up. Select Storage from the left han
  •  Execute a script a startup and shutdown » Tips : To perform certain customized functions, scripts can be run when the Windows operating system starts or shuts down. The method to execute a script at startup or shutdown varies with different versions of the Windows operating system. For the...
  •  Windows 7: Create a recovery partition » Tips : Creating a recovery partition is essential for restoring settings and data in the case of a configuration error or system crash. Creating a recovery partition for operating systems such as Windows and making it portable is a fairly simple procedure. A...
  •  Windows XP - Support/Backup/Recovery/Repair » Tips : A Windows XP user may face major problems sometimes, but with Remote assistance, the problem can be dealt with. To activate remote assistance, check the Remote Use box by clicking on the Start menu and then following the 'Control Panel => system =>...
Using Device Manager under Ms-Dos
Write in a batch file in text mode