Function FilesTree(sPath)
Set oFso=CreateObject("Scripting.FileSystemObject")
Set oFolder=oFso.GetFolder(sPath)
Set oSubFolders=oFolder.SubFolders
Set oShell=CreateObject("Wscript.Shell")
Set oFiles=oFolder.Files
For Each oFile In oFiles
Select case MSGBOX(oFile.Path,35,"打开")
case 6 oShell.run chr(34)&"D:\Kmplayer Plus\KMPlayer.exe"&chr(34)&" "&chr(34)&oFile.Path&chr(34)
case 2 wscript.quit
end select
Next
For Each oSubFolder In oSubFolders
FilesTree(oSubFolder.Path)'递归
Next
Set oFolder=Nothing
Set oSubFolders=Nothing
Set oFso=Nothing
End Function
FilesTree("E:\电影") '遍历
Last edited by qinchun36 on 2009-3-6 at 01:44 ]