[Closed] Create .bat file
I need a two simple functions that creates two .bat file which will by using ShellLaunch fn compress all files in dir and sub-dirs into a single archive (.7z and .rar).
So first fn will use 7zip archiver and second WinRAR.
Thanks in advance.
i use winrar…might little help for ya…
its raw, but you get the idea…
rarPath= "C:\\Program Files\\WinRAR" ---we setting it via script
rarProg="rar.exe"
Winrar="\""+rarPath+"\""+" "+rarProg
doWinRAR= "start /d" +" "+ Winrar
theSwitch="a -ac -ai -ep1 -kb -m5 -ibck -os -rr3p -s -df -ds -ed -r -y"
DestinationRAR=myRarFile
SourceRAR=AllFileInMyDir ---in one folder
StartWinRAR=doWinRAR+" "+theSwitch+" "+"\""+DestinationRAR+"\""+" "+"\""+SourceRAR+"\""
DOSCommand StartWinRAR
basicly you must copy all file you need in one folder before you rar it.
With .bat will be probably similar. Very cool, friend.
Tell me is this highest commpresion methot ei. “Best”?
For 7zip can you do similar approch?
edit:
Why do you separate “rarPath” and “rarProg”?
I think 3.5 or 4 not 4.5 for sure. But I use win8.1 that comes with the version 4.5.1
Why U ask? Are you suggest something different ei.better?:hmm: I’m listening
System.IO.Compression.ZipFile
http://msdn.microsoft.com/en-us/library/System.IO.Compression%28v=vs.110%29.aspx
it works very well. but i haven’t tried it with max yet.
Yup. max 2014 not recognize this class. So I need to stay with rar and 7zip.
Can you show me how to make theses two fn’s that I describet above?
How?
I not undertand how correctly write string pattern. Also if folder is big maybe is better allow user to see progress
HiddenDOSCommand "rar a -r archivename.rar *.* folderfrom"
which means:
using rar archive -recursive into file all files from folder…
What about compression level. Fajar is used this pattern “a -ac -ai -ep1 -kb -m5 -ibck -os -rr3p -s -df -ds -ed -r -y”.
Why everybody avoid 7z which is free and use better compression algoritam then rar?
i don’t know all keys. you probably have to read a documentation for winrar command line options.
but as i know the difference is minimal. the default setting are working well. bit of course you always have an option to make something fancy.
Fancy is cool
I think -m5 is compress-level (Best). 7zip use -m9 or something like that for Ultra compression.
maybe. and it makes a compressed file 10% smaller than default, but makes it 5 times slower.
all fancy compression algorithms are usually used for compression specific or ‘bad’ data. like white noise for example.
About that U are right. I need to compress whole project folder which is in most cases 500-1000MB. That’s why I want best compress level and to know when is process done.
With HDC I can’t see this and I know that this can be very slow.
I tried once KGB archiver with max level. Compression is amazing but this can take 24h