回覆列表
  • 1 # 使用者4949203824021

    OptionExplicit

    DimobjFso,objSrcFls,strSrcFld,objFile,objDstFile,strDstFile

    strSrcFld="e:\download\""原始檔夾,請自行更改

    strDstFile="e:\vbs\FileLists.txt""輸出的目標檔案,請自行更改

    SetobjFso=CreateObject("Scripting.FileSystemObject")

    SetobjDstFile=objFso.OpenTextFile(strDstFile,2,True)

    SetobjSrcFls=objFso.GetFolder(strSrcFld).Files

    ForEachobjFileInobjSrcFls

    objDstFile.WriteLinestrSrcFld&objFile.Name

    Next

    DimobjFld,objSrcFld

    SetobjSrcFld=objFso.GetFolder(strSrcFld).SubFolders

    ForEachobjFldInobjSrcFld

    CallLoopSubFlds(strSrcFld&objFld.Name&"\")

    Next

    objDstFile.Close

    SetobjFile=Nothing

    SetobjSrcFls=Nothing

    SetobjFso=Nothing

    SubLoopSubFlds(strFld)

    ForEachobjFileInobjFso.GetFolder(strFld).Files

    objDstFile.WriteLinestrFld&objFile.Name

    Next

    ForEachobjFldInobjFso.GetFolder(strFld).SubFolders

    CallLoopSubFlds(strFld&objFld.Name&"\")

    Next

    EndSub

  • 中秋節和大豐收的關聯?
  • 史萊姆不凝固怎麼辦?