遍历文件夹下文件写入文本
2014-04-24 13:16
211 查看
set f=ofso.opentextfile("D:\print.txt",2,true)
f.write a
f.close
msgbox "完成。"
Function TreeIt(sPath)
on error resume next
Set oFso = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFso.GetFolder(sPath)
Set oSubFolders = oFolder.Subfolders
Set oFiles = oFolder.Files
Set qtLibraries = qtApp.Test.Settings.Resources.Libraries
For Each oFile In oFiles
a=a & ofile.path & vbcrlf
Next
For Each oSubFolder In oSubFolders
TreeIt(oSubFolder.Path)
Next
End Function
f.write a
f.close
msgbox "完成。"
Function TreeIt(sPath)
on error resume next
Set oFso = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFso.GetFolder(sPath)
Set oSubFolders = oFolder.Subfolders
Set oFiles = oFolder.Files
Set qtLibraries = qtApp.Test.Settings.Resources.Libraries
For Each oFile In oFiles
a=a & ofile.path & vbcrlf
Next
For Each oSubFolder In oSubFolders
TreeIt(oSubFolder.Path)
Next
End Function
相关文章推荐
- Asp.Net 文件操作基类(读取,删除,批量拷贝,删除,写入,获取文件夹大小,文件属性,遍历目录)(一)
- dos遍历文件夹,把文件写入同一文件中
- Android 建立文件夹、生成文件并写入文本文件内容
- Asp.Net 文件操作基类(读取,删除,批量拷贝,删除,写入,获取文件夹大小,文件属性,遍历目录)(二)
- Asp.Net 文件操作基类(读取,删除,批量拷贝,删除,写入,获取文件夹大小,文件属性,遍历目录)(一)
- Asp.Net 文件操作基类(读取,删除,批量拷贝,删除,写入,获取文件夹大小,文件属性,遍历目录)(二)
- Asp.Net 文件操作基类(读取,删除,批量拷贝,删除,写入,获取文件夹大小,文件属性,遍历目录)
- JAVA 一个简单的文件写入代码(遍历文件夹获取所有文件、写入缓冲池、获取文件绝对路径、按后缀名过滤文件)
- [导入]Asp.Net 文件操作基类(读取,删除,批量拷贝,删除,写入,获取文件夹大小,文件属性,遍历目录)(一)
- Android 建立文件夹、生成文件并写入文本文件内容
- Asp.Net 文件操作基类(读取,删除,批量拷贝,删除,写入,获取文件夹大小,文件属性,遍历目录)
- Java学习随笔3:遍历文件夹及文件的读取和写入
- java:利用递归遍历整个文件夹并写入文件
- [导入]Asp.Net 文件操作基类(读取,删除,批量拷贝,删除,写入,获取文件夹大小,文件属性,遍历目录)(二)
- Asp.Net 文件操作基类(读取,删除,批量拷贝,删除,写入,获取文件夹大小,文件属性,遍历目录)
- 遍历文件和文件夹,并用滚动条显示进度和写入错误日志
- 文件的打开、复制、写入、创建、删除、获取设置 文件属性 查找文件 遍历文件夹等14.4.26
- Asp.Net 文件操作基类(读取,删除,批量拷贝,删除,写入,获取文件夹大小,文件属性,遍历目录)
- Android 建立文件夹和文件并向文件写入文本
- Asp.Net 文件操作基类(读取,删除,批量拷贝,删除,写入,获取文件夹大小,文件属性,遍历目录)