Extracting RAR files automatically through ASP

Source: Internet
Author: User
Tags rar

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.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.