久久国产成人av_抖音国产毛片_a片网站免费观看_A片无码播放手机在线观看,色五月在线观看,亚洲精品m在线观看,女人自慰的免费网址,悠悠在线观看精品视频,一级日本片免费的,亚洲精品久,国产精品成人久久久久久久

分享

VBS 獲取目錄中所有文件列表

 ZackEdge 2015-02-19
VBS 獲取指定文件夾根目錄所有文件和根目錄所有文件夾列表(多級的文件夾不要),并循環(huán)輸出,。

------解決方案--------------------
VBScript code
str = "e:\script\vbs"
ListFolder1 str
ListFolder2 str
ListFolder3 str

Sub ListFolder1(strFolder)

    Set oFSO = CreateObject("Scripting.FileSystemObject")
    Set oFolder = oFSO.GetFolder(strFolder)
    strOut = strOut & "文件夾:" & vbCrLf
    For Each x In oFolder.SubFolders
        strOut = strOut & x.Name & vbCrLf
    Next
    strOut = strOut &  "文件:" & vbCrLf
    For Each x In oFolder.Files
        strOut = strOut &  x.Name & vbCrLf
    Next
    WScript.Echo strOut
    
End Sub

Sub ListFolder2(strFolder)
    '不能處理隱藏文件
    Set oShell = CreateObject("Shell.Application")
    Set oFolder = oShell.NameSpace(strFolder)
    For Each x In oFolder.Items
        strOut = strOut & x.Type & vbTab & x.Path & vbCrLf
    Next
    WScript.Echo strOut
    
End Sub

Sub ListFolder3(strFolder)

    Set oWMI = GetObject("Winmgmts:")
    For Each x In oWMI.ExecQuery("ASSOCIATORS OF {Win32_Directory.Name='"& strFolder &"'}" & "where ResultClass = CIM_logicalfile")
        strOut = strOut &  x.Name & vbCrLf
    Next
    WScript.Echo strOut

End Sub

    本站是提供個(gè)人知識管理的網(wǎng)絡(luò)存儲空間,,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn),。請注意甄別內(nèi)容中的聯(lián)系方式,、誘導(dǎo)購買等信息,謹(jǐn)防詐騙,。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,,請點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多