How to make a batch file to execute win rar in multiple folders

3k views Asked by At

Iam really new to batch files so pls bear with me. I want to make a batch file that can take folders from different locations and then zip it in to one win rar file in a location like

c:\projects\test 
c:\www\site
c:\logs\office

to

c:backup\{{date}}_backup.rar

thanx in advance

1

There are 1 answers

0
Endoro On BEST ANSWER
@echo off
(
echo c:\projects\test 
echo c:\www\site
echo c:\logs\office
)>list.txt
"%programfiles%\winrar\rar" a "c:\backup\%date:/=-%_backup.rar" @list.txt

If you are on Win-x64 set the rar path: "%programfiles(x86)%\winrar\rar"