unpack.vbs
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
相關(guān)文章
當(dāng)某IP 連接我機(jī)器的3389端口 報(bào)警的腳本
希望大牛能夠?qū)懸粋€(gè)腳本監(jiān)視 當(dāng)某IP 連接我機(jī)器的3389端口時(shí)報(bào)警。。。2009-03-03
VBS 自動(dòng)登錄論壇的實(shí)現(xiàn)代碼
這篇文章主要介紹了如果通過vbs實(shí)現(xiàn)論壇自動(dòng)登錄的實(shí)現(xiàn)方法,其實(shí)主要利用了vbs操作網(wǎng)頁表單的自動(dòng)填寫實(shí)現(xiàn),喜歡的朋友可以試試2013-07-07
vbs腳本和windows定時(shí)任務(wù)實(shí)現(xiàn)qq消息表情包定時(shí)發(fā)送功能
這篇文章主要介紹了vbs腳本和windows定時(shí)任務(wù)實(shí)現(xiàn)qq消息表情包定時(shí)發(fā)送,整個(gè)過程不用過多的程序運(yùn)行,我們借助vbs腳本和windows定時(shí)任務(wù)去實(shí)現(xiàn)這一功能,需要的朋友可以參考下2022-01-01
VBS教程:函數(shù)-DateValue 函數(shù)
VBS教程:函數(shù)-DateValue 函數(shù)...2006-11-11

