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

首頁 > 編程 > VBScript > 正文

unpack.vbs

2020-07-26 12:15:38
字體:
來源:轉載
供稿:網友

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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 桃园县| 沛县| 双辽市| 鄂伦春自治旗| 斗六市| 仁怀市| 桐柏县| 珲春市| 梁山县| 汨罗市| 楚雄市| 山阴县| 桦甸市| 全椒县| 铜山县| 阿拉善左旗| 韩城市| 黔西县| 红安县| 武强县| 林芝县| 阿克苏市| 城固县| 靖边县| 泾川县| 辽宁省| 八宿县| 无极县| 遂昌县| 台湾省| 德令哈市| 河曲县| 时尚| 白朗县| 普宁市| 友谊县| 佛冈县| 赤壁市| 滨州市| 京山县| 金川县|