• 企业400电话
  • 微网小程序
  • AI电话机器人
  • 电商代运营
  • 全 部 栏 目

    企业400电话 网络优化推广 AI电话机器人 呼叫中心 网站建设 商标✡知产 微网小程序 电商运营 彩铃•短信 增值拓展业务
    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

    上一篇:vbs得没公开对象
    下一篇:使用批处理文件异地备份数据库(最近几天的数据)
  • 相关文章
  • 

    © 2016-2020 巨人网络通讯 版权所有

    《增值电信业务经营许可证》 苏ICP备15040257号-8

    unpack.vbs unpack.vbs,unpack.vbs,