shell

File compression using winrar with Batch File

A brief technical note outlining the basic approach and applicable steps for compressing files using winrar with Batch File.

To compress a folder using winrar with batch file, the following commands may be useful. Arrange the file addresses according to your needs.

C:

cd\

cd C:\Program Files (x86)\WinRAR

rar a  -r "D:\test\Backup_%DATE:~7,2%-%DATE:~4,2%-%DATE:~-4%_%TIME:~0,2%-%TIME:~3,2%-%TIME:~-5,2% .rar"  "D:\test\testdirectory"