国产探花免费观看_亚洲丰满少妇自慰呻吟_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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 延庆县| 大兴区| 名山县| 徐州市| 简阳市| 新乡市| 隆安县| 曲麻莱县| 湘潭县| 西华县| 策勒县| 安塞县| 库尔勒市| 新营市| 昌都县| 定边县| 吉安县| 诏安县| 沙田区| 金坛市| 梧州市| 陇西县| 通江县| 高雄县| 阿尔山市| 溧阳市| 新密市| 资讯 | 崇文区| 亚东县| 东乌珠穆沁旗| 山西省| 宿迁市| 通辽市| 抚松县| 陈巴尔虎旗| 万源市| 寿光市| 仙桃市| 巴中市| 甘孜县|