@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"
Question
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
Solution
@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"