首页 > 工具收集 > vbs-mdb解包

vbs-mdb解包

2008年4月6日 发表评论 阅读评论

可能有人会用到,自己以后也会用到,收集起来:

<br />Dim rs, ws, fso, conn, stream, connStr, theFolder <br />Set rs = CreateObject("ADODB.RecordSet") <br />Set stream = CreateObject("ADODB.Stream") <br />Set conn = CreateObject("ADODB.Connection") <br />Set fso = CreateObject("Scripting.FileSystemObject") <br />connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=当前目录中mdb文件;" <br />conn.Open connStr <br />rs.Open "FileData", conn, 1, 1 <br />stream.Open <br />stream.Type = 1 <br />On Error Resume Next <br />Do Until rs.Eof <br />    theFolder = Left(rs("thePath"), InStrRev(rs("thePath"), "&#92;")) <br />    If fso.FolderExists(theFolder) = False Then <br />        createFolder(theFolder) <br />    End If <br />    stream.SetEos() <br />    stream.Write rs("fileContent") <br />    stream.SaveToFile str & rs("thePath"), 2 <br />    rs.MoveNext <br />Loop <br />rs.Close <br />conn.Close <br />stream.Close <br />Set ws = Nothing <br />Set rs = Nothing <br />Set stream = Nothing <br />Set conn = Nothing <br />Wscript.Echo "所有文件释放完毕!" <br />Sub createFolder(thePath) <br />    Dim i <br />    i = Instr(thePath, "&#92;") <br />    Do While i > 0 <br />        If fso.FolderExists(Left(thePath, i)) = False Then <br />            fso.CreateFolder(Left(thePath, i - 1)) <br />        End If <br />        If InStr(Mid(thePath, i + 1), "&#92;") Then <br />            i = i + Instr(Mid(thePath, i + 1), "&#92;") <br />         Else <br />            i = 0 <br />        End If <br />    Loop <br />End Sub<br />

转载请注明:woyigui's blog [http://www.woyigui.cn/]
本文标题:vbs-mdb解包
本文地址:http://www.woyigui.cn/2008/04/06/vbs-mdb-unpacked/

  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.
*