<%
dim fpath(1)
FPath(0)=server.mappath("myfile.txt")
Fpath(1)=server.mappath("myfolder")
RarFilePath=server.mappath("1.rar")
RarSoftWarePath="C:Program FilesWinRARWinRAR.exe"
for i=0 to ubound(fpath)
rar RarSoftWarePath,RarFilePath,FPath(i),"a"
next
sub rar(RarSoftWarePath,RarFilePath,FPath,aorx) 'rar过程
set shell=server.createobject("wscript.shell")
rarcmd=""""&RarSoftWarePath&""" "&aorx&" -t -o+ "
shcmd=rarcmd&""""&RarFilePath&""" """&FPath&""""
shell.run shcmd,0,true
set shell=nothing
end sub
%>
rar过程参数说明
RarSoftWarePath为winrar软件的路径
RarFilePath为RAR文件路径
FPath为被压缩的文件夹或文件的路径,或解压的路径
aorx可取"a"或"x"值,"a"值表示压缩,"x"值表示解压缩