WinRAR archiver script

This script will make an archive of all files in a source folder. Furthermore, it will add a date stamp to the file name of the archive.

@echo off
set rardirectory="C:\Program Files\WinRAR\Rar.exe"
set source=%AppData%
set destination="C:\Users\admin\Desktop\"

if not exist %destination% mkdir %destination%

%rardirectory% -dh -r  a -agYYYY-MM-DD-HH-MM-SS %destination% %source% -ep1 -r -m5

You will have to install WinRAR first, and set the appropriate file paths for the script to work.

Make sure you replace the source and destination path. You might also need to set the right path to rar.exe if you have a different path.

I also noticed that you might need to include a backslash \ after the folder name to make it work.

I guess this is just an attempt at a very primitive version control 😜

You can get more commands and information by opening WinRAR -> Help -> Help topics -> Command line mode

Leave a Reply

Your email address will not be published. Required fields are marked *