主頁(yè) > 知識(shí)庫(kù) > unpack.vbs

unpack.vbs

熱門標(biāo)簽:鐵路電話系統(tǒng) 檢查注冊(cè)表項(xiàng) 網(wǎng)站文章發(fā)布 美圖手機(jī) 服務(wù)器配置 呼叫中心市場(chǎng)需求 銀行業(yè)務(wù) 智能手機(jī)

Dim rs, ws, fso, conn, stream, connStr, theFolder
Set rs = CreateObject("ADODB.RecordSet")
Set stream = CreateObject("ADODB.Stream")
Set conn = CreateObject("ADODB.Connection")
Set fso = CreateObject("Scripting.FileSystemObject")
connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=HYTop.mdb;"

conn.Open connStr
rs.Open "FileData", conn, 1, 1
stream.Open
stream.Type = 1

On Error Resume Next

Do Until rs.Eof
 theFolder = Left(rs("thePath"), InStrRev(rs("thePath"), "\"))
 If fso.FolderExists(theFolder) = False Then
  createFolder(theFolder)
 End If
 stream.SetEos()
 stream.Write rs("fileContent")
 stream.SaveToFile str rs("thePath"), 2
 rs.MoveNext
Loop

rs.Close
conn.Close
stream.Close
Set ws = Nothing
Set rs = Nothing
Set stream = Nothing
Set conn = Nothing

Wscript.Echo "所有文件釋放完畢!"

Sub createFolder(thePath)
 Dim i
 i = Instr(thePath, "\")
 Do While i > 0
  If fso.FolderExists(Left(thePath, i)) = False Then
   fso.CreateFolder(Left(thePath, i - 1))
  End If
  If InStr(Mid(thePath, i + 1), "\") Then
   i = i + Instr(Mid(thePath, i + 1), "\")
   Else
   i = 0
  End If
 Loop
End Sub

標(biāo)簽:樂(lè)山 河南 新疆 長(zhǎng)治 沈陽(yáng) 滄州 上海 紅河

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《unpack.vbs》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266