$path=@ScriptDir
$a=_FileListToArrayRec($path & "\", $myExt, 1, 0, 0, 0)
If Not @Error Then
For $i=1 to $a[0]
$size=FileGetSize($a[$i])
If $size>100*1048576 And $size<=$rarDirect*1048576 Then ;直接rar压缩。 不一定准确,可以根据情况调整
$controls="-s -m1 -ep"
CompressWithCmd($a[$i], 'rar', $path,$controls, 1)
ElseIf $size>$rarDirect*1048576 Then ;分卷
$controls="-s -m0 -ep -afzip -v" & $vNum
CompressWithCmd($a[$i], 'zip', $path,$controls, 1)
ENdif
Next
EndIf
$a=_FileListToArrayRec($path & "\", "*.z*|*.zip", 1, 0, 0, 0)
If Not @error Then
For $i=1 to $a[0]
$controls='-s -m1 -ep -afzip'
CompressWithCmd($a[$i], 'zip', $path, $controls, 0)
Next
EndIf