復制代碼 代碼如下:
<% @language=vbscript codepage=936 %>
<%
'批量文件自動搜索替換插入器 Ver2.0
'飛雲編寫,CSDN帳號:jspadmin,QQ:33323489
'個人網站http://www.pifoo.com 蚍蜉中文站,歡迎交換鏈接。本站提供免費博客申請注冊。
'你可以使用或修改本代碼,但是請保留版權信息或鏈接,謝謝使用!
'如果有問題或建議,請給我留言 http://www.pifoo.com/guestbook/
%>
<%
bakpath=request("bakpath")
delbak=server.mappath(bakpath)
set fso = createobject("scripting.filesystemobject")
response.write "刪除操作結果如下:" & "<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 & "已經被成功刪除!<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">返回首頁</A>