Original author: Cold mo
In fact, want to achieve this function is very simple, first of all to upload a RAR decompression program, is RAR own decompression program, only need its core
Program RAR.EXE this file is OK. Then you will upload a program that executes RAR.EXE CMD. EXE This is a program in Windows (don't need me to say it). Finally, we started to implement these procedures. Take a look at the following code
<%
Dim Ylj,ywj,mlpath,shell,rarcomm,retcode,cmd,comm,fso
Mlpath= "E:\page\mian\" to store RAR.EXE and CMD.EXE paths
Ylj=server.mappath ("Mian") & "\" The path after extracting the file
Ywj=server.mappath ("Mian\apathy.rar") ' RAR file to extract
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)
%>
is to use Server.CreateObject ("Wscript.Shell") to perform CMD.EXE to run RAR.EXE files to extract RAR files.
I didn't know if any of the predecessors had published these articles, but the brother is interested in using this method to achieve many similar and such procedures, I hope you can find some better ways.