|
vbs遍历目录 樱木花盗 发表于 2007-7-10 11:49:06 |
Function TreeIt(sPath) Set oFso = CreateObject("Scripting.FileSystemObject") Set oFolder = oFso.GetFolder(sPath) Set oSubFolders = oFolder.Subfolders
Set oFiles = oFolder.Files For Each oFile In oFiles WScript.Echo oFile.Path Next
For Each oSubFolder In oSubFolders WScript.Echo oSubFolder.Path TreeIt(oSubFolder.Path)'递归 Next
Set oFolder = Nothing Set oSubFolders = Nothing Set oFso = Nothing End Function
TreeIt("c:\1") '遍历 |
|
发表评论:
|