In this scenario I would like to backup a folder with documents at a given time. It is important for me to keep older versions of the files.
The batch code for this would look something like:
set rardirectory="C:\Program Files\WinRAR\Rar.exe" :choice set /P c=Are you sure you want to continue[Y/N]? if /I "%c%" EQU "Y" goto :continue if /I "%c%" EQU "N" goto :leave goto :choice :continue set source="C:\Windows\Web" set destination="C:\Users\username\Desktop\" if not exist %destination% mkdir %destination% echo SOURCE: %source% echo: DESTINATION: %destination% echo( %rardirectory% -dh -r a -agYYYY-MM-DD-HH-MM-SS %destination% %source% -ep1 -r -m5
This will give you the command line:
C:\Users\fasil\Desktop>set rardirectory="C:\Program Files\WinRAR\Rar.exe" C:\Users\fasil\Desktop>set /P c=Are you sure you want to continue[Y/N]? Are you sure you want to continue[Y/N]?
The folder structure should be something like:
backup2019-03-08-22-00-05.rar ├── Web │ ├── 4K │ ├── Screen │ ├── Wallpaper