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>