国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > VBScript > 正文

unpack.vbs

2020-06-26 17:41:14
字體:
供稿:網(wǎng)友

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

 

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 泗洪县| 中方县| 甘肃省| 唐河县| 汕尾市| 崇礼县| 永新县| 东源县| 油尖旺区| 瑞金市| 襄城县| 信宜市| 中山市| 鹤庆县| 翁牛特旗| 拉萨市| 九台市| 安顺市| 江源县| 卫辉市| 威海市| 江都市| 和硕县| 漳平市| 叙永县| 鄂尔多斯市| 正宁县| 莎车县| 苏州市| 新干县| 闽侯县| 岳池县| 岳普湖县| 墨脱县| 肃南| 蒲江县| 香港| 苍山县| 全椒县| 嘉义市| 大方县|