时间:2021-07-01 10:21:17 帮助过:47人阅读
<%
dim ylj,ywj,Mlpath,Shell,rarcomm,RetCode,cmd,comm,fso
Mlpath="E:\page\mian\" '存放RAR.EXE和CMD.EXE的路径
ylj=Server.mappath("mian")&"\" '解压文件后所放的路径
ywj=Server.mappath("mian\apathy.rar") '要解压的RAR文件
Set Shell = Server.CreateObject("WScript.Shell")
rarcomm= "E:\page\mian\cmd.exe /c "&Mlpath&"rar.exe x -t -o+ -p- "
cmd=rarcomm&ywj&" "&ylj
RetCode = Shell.Run(cmd,1, True)
%>
就是用Server.CreateObject("WScript.Shell")来执行CMD.EXE来运行RAR.EXE文件来解压RAR文件的。