Using ASP to realize batch Delete bak file _ application Technique

Source: Internet
Author: User
Copy Code code as follows:

<% @language =vbscript codepage=936%>
<%
' Batch file Auto search replace insert Ver2.0
' Feiyun wrote, CSDN account: jspadmin,qq:33323489
' Personal website http://www.pifoo.com 蚍蜉 Chinese Station, Welcome to exchange links. This site provides free blog application registration.
' You can use or modify this code, but please keep the copyright information or links, thank you for using!
' If you have any questions or suggestions, please leave me a message http://www.pifoo.com/guestbook/
%>
<%
Bakpath=request ("Bakpath")
Delbak=server.mappath (Bakpath)
Set fso = CreateObject ("Scripting.FileSystemObject")
Response.Write "The delete operation result is as follows:" & "<br>"
Iterate (Delbak)
function iterate (PATH)
Dim folder, folders, files, file
Set folder = Fso.getfolder (path)
Set files = Folder.files
For each file in files
If Fso.getextensionname (file.name) = "Bak" Then
Response.Write File.name & "has been successfully deleted! <br> "& File.path &" <br><br> "
File.delete true
End If
Next
Set folders = Folder.subfolders
For each F in folders
Iterate F.path
Next
End Function
Set fso=nothing
%>
<a href= "index.asp" > Back home </A>
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.