views:

16

answers:

1

hi guys, i have this scripts which extracts all my folder's and files from my c:\projects locations and put its in winrar and transfers them to c:\backup\project

for /f "delims==" %%D in ('DIR C:\projects /A /B /S') do (
"C:\Program Files\WinRAR\WinRAR.EXE" m -r "c:\backup\projects.rar" "%%D"
)

i have also tried the below script which uses the same source c:\projects

but put them in their own separate winrar folder like in the source then transfers the folders into my c:\backup.

FOR /F "DELIMS==" %%D in ('DIR C:\projects /AD /B') DO (
"C:\Program Files\WinRAR\WinRAR.EXE" m -r "C:\Backup\%%D.rar" "%%D"
)

my question is, my second scripts only takes two hours to run when my first script takes over 24 hours to run, is there any way to make my first script faster? if anything shouldn't my first script be faster?

A: 

My guess is that your "c:\backup\projects.rar" archive is a solid archive, which means that it needs to be re-packed entirely each time you add something to it. Try changing it to non-solid archive and I think you should see improvement.

The second thing you could try is to do a single call to WinRar with file-list (or even a mask) of what folders to add instead of calling it independently for each folder.

Rotsor
how do i change it to a non-solid archive?
Jessie
I'm not sure if you can change existing archive. But you definitely can create a new one. It is controlled by the "Create solid archive" option or by -S (enable solid) / -S- (disable solid) command line switches.
Rotsor