Simply compress 1 folder in batch with WinRAR command line? -
Simply compress 1 folder in batch with WinRAR command line? -
using winrar command line (c:\program files\winrar\rar.exe), i'm trying compress single folder (c:\users\%username%\desktop\somefolder) , perchance alter name of .zip file created. i've tried "rar.exe "c:\users\%username%\desktop\somefile" , works, compresses folder (not 1 put).
what doing wrong?
can provide explanation (and maybe tell me recursion because i'm unfamiliar it)?
thanks
use either
"c:\program files\winrar\rar.exe" -ep1 -r "name of zip file path" "c:\users\%username%\desktop\somefolder" to create zip file specified name after command a (archive) , switches -ep1 (exclude base of operations directory names) , -r (recursive), or use
"c:\program files\winrar\rar.exe" -ep1 -r "name of zip file path" "c:\users\%username%\desktop\somefolder\" the folder somefolder is included in archive first command line without backslash @ end.
the folder somefolder is not included in archive, files , subdirectories of folder, sec command line with backslash @ end.
in other words alternative -ep1 results in omitting path lastly backslash in specified file or folder name on adding file or folder archive explains difference on adding folder or without backlash @ end specified on command line.
recursion means add together not files in specified folder, subfolders , files in subfolders.
so rar must search first in specified folder subfolder. if found go subfolder , search 1 time again subfolder. if 1 found, go subfolder , search subfolder. if no 1 found, add together files in subfolder archive or folder name if subfolder empty. go parent folder , go on searching next subfolder. if none found, add together files of subfolder. go parent folder , go on search subfolder, , on.
as can read, same process done 1 time again , 1 time again each branch of entire folder tree until subfolders processed. done using recursion. subroutine searching subfolders calls every time subfolder found.
batch-file winrar
Comments
Post a Comment