手机
当前位置:查字典教程网 >脚本专栏 >vbs >unpack.vbs
unpack.vbs
摘要:Dimrs,ws,fso,conn,stream,connStr,theFolderSetrs=CreateObject("ADODB.Re...

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

【unpack.vbs】相关文章:

vbs实用软件自造——Windows脚本应用实例

ipclear.vbs源代码

vbs列出内网的中计算机(工作组也可以)

QWERTY密码:加密与解密vbs版

VBS读网页的代码

利用sql语句复制一条或多条记录

用vbs模拟的一个asp的分页显示功能

VBScript教程 第十一课深入VBScript

Iiscnfg.vbs IIS 配置脚本

文件备份vbs脚本

精品推荐
分类导航