标题: vbs遍历当前目录所有文件 [打印本页]
作者: batman 时间: 2009-4-6 14:59 标题: vbs遍历当前目录所有文件
- dim path,allfile
- set wshshell=createobject("wscript.shell")
- path=wshshell.currentdirectory
- set objfso=createobject("scripting.filesystemobject")
- set objfolders=objfso.getfolder(path).subfolders
- for each objfolder in objfolders
- path=objfolder:allfile=""
- set objfiles=objfso.getfolder(path).files
- for each objfile in objfiles
- allfile=allfile&vbcrlf&objfile.name
- next
- wshshell.popup objfolder&"下的文件:"&vbcrlf&allfile,3
- next
- set objfiles=nothing
- set objfolders=nothing
- set objfso=nothing
- set wshshell=nothing
复制代码
[ 本帖最后由 batman 于 2009-4-6 15:02 编辑 ]
作者: Batcher 时间: 2009-4-6 15:11
微软脚本中心有些例子
http://www.microsoft.com/china/t ... folder/default.mspx
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |