数码资讯
VBS搜索文件名或得到一个目录列表
点评:在互联网上更改一个小程序是很方便的,而且这个搜索效率很好。 下次继续出错 昏暗的关键词,dirtotal,timespend,filetotal,FSO,导出的文件,txtresult,txtpath,路径 const my_computer = H11 const window_handle
选购提示
关注价格、性能、续航、售后和真实使用场景,理性比较后再下单。
点评:在互联网上更改一个小程序是很方便的,而且这个搜索效率很好。
下次继续出错
昏暗的关键词,dirtotal,timespend,filetotal,FSO,导出的文件,txtresult,txtpath,路径
const my_computer = H11
const window_handle = 0
常量选项= 0
设定目标
在因特网上改变一个小程序是非常方便的,这是非常有效的。
下次继续出错
昏暗的关键词,dirtotal,timespend,filetotal,FSO,导出的文件,txtresult,txtpath,路径
const my_computer = H11
const window_handle = 0
常量选项= 0
集objshell = CreateObject(壳。应用)
听听听= objshell设置命名空间(my_computer)。
听听听自己设置objfolderitem =。
strpath = objfolderitem。路径
听听听= objshell.browseforfolder集(window_handle,选择文件夹你想搜索:
如果听听听是什么那
MsgBox你不选择任何有效的目录!
wscript.quit
其他的
听听听自己设置objfolderitem =。
= objfolderitem路径。路径
txtpath =路径
设置FSO = wscript.createobject(脚本。FileSystemObject )
filetotal = 0
dirtotal = 0
佛焰苞=左(Wscript.scriptFullName,Len(名。scriptfullname)-莱恩(名。scriptname))
txtpath =装饰(InputBox(你选定的目录文件搜索路径,
关键词= 1例(InputBox(请输入搜索关键字点取消就可以列出一张目录:
设置文件= fso.createtextfile(路径 SearchResult .txt)
outfile.writeline开始搜索…
outfile.writeline启动目录:txtpath
timespend =定时器
myfind txtpath
timespend =圆(计时器- timespend,2)
txtresult =搜索完成!vbcrlf找到文件共:filetotal
outfile.write txtresult
本txtresult quot;结果保存在路径; SearchResult .txt
outfile.close
设置文件=没有
设置FSO
子myfind(ByVal路径)
昏暗的FSO,myfolder,来,curfolder
设置FSO = wscript.createobject(脚本。FileSystemObject )
集curfolders = fso.getfolder(路径)
dirtotal dirtotal = 1
如果curfolders.files.count > 0
在每个文件中的文件curfolders。
If InStr (1, LCase (myFile.Name), keyWord) > 0 Then
outfile.writeline formatpath(路径)的名字来。
filetotal filetotal = 1
最后如果
下一个
最后如果
如果curfolders.subfolders.count > 0
每个myfolder在curfolders.subfolders
MyFind FormatPath(路径)myfolder。名字
下一个
最后如果
端子
功能formatpath(ByVal路径)
路径=装饰(路径)
formatpath =路径
如果对(道路,1)= 然后formatpath =中(路径、1、Len(路径)- 1)
端功能
最后如果
=======================================================================
附录:关于打开目录的方面:
私人const csidl_desktop = H0
私人const csidl_internet = H1的Internet Explorer(图标在桌面上)
私人const csidl_programs = H2的开始菜单程序
私人const csidl_controls = H3的'我的电脑控制面板
私人const csidl_printers = H4的'我的电脑打印机
私人const csidl_personal = H5的我的文档
私人const csidl_favorites = H6的收藏夹
私人const csidl_startup = H7的开始菜单程序启动
私人const csidl_recent = H8最近
私人const csidl_sendto = H9 SendTo
私人const csidl_bitbucket =哈回收站
私人const csidl_startmenu = HB 开始菜单
私人const csidl_mydocuments = HC逻辑我的文档图标
私人const csidl_mymusic =高清我的音乐文件夹
私人const csidl_myvideo =他我的视频文件夹
私人csidl_desktopdirectory = const的H10 桌面
私人csidl_drives = const H11的'我的电脑
私人const csidl_network = H12的网络邻居(我的网络)
私人const csidl_nethood = H13的ethood
私人const csidl_fonts = H14的Windows 字体
私人const csidl_templates = H15
私人const csidl_common_startmenu = H16的所有用户的开始菜单
私人const csidl_common_programs = H17的所有用户开始菜单程序
私人const csidl_common_startup = H18的所有用户启动
私人const csidl_common_desktopdirectory = H19的所有用户桌面
私人const csidl_appdata = H1a应用数据
私人const csidl_printhood = H1B的 printhood
私人const csidl_local_appdata = H1C本地设置应用数据(非漫游)
私人const csidl_altstartup = H1D非本地化的启动
私人const csidl_common_altstartup = H1E非局部共同启动
私人const csidl_common_favorites = H1F
私人const csidl_internet_cache = h20'temporary Internet文件
私人const csidl_cookies = H21
私人const csidl_history = H22
私人const csidl_common_appdata = H23的所有用户应用数据
私人const csidl_windows = H24的返回窗口WINDOWS目录是是是()
私人const csidl_system = H25的getsystemdirectory()
私人const csidl_program_files = H26 C:程序文件
私人const csidl_mypictures = H27 C:程序文件我的照片
私人const csidl_profile = H28的用户配置文件
私人const csidl_systemx86 = H29的x86系统目录RISC
私人const csidl_program_filesx86 = H2A的x86 C:程序文件对RISC
私人const csidl_program_files_common = H2B C:程序文件共同
私人const csidl_program_files_commonx86 = H2C的x86程序文件共同RISC
私人const csidl_common_templates = H2D的所有用户 templates_
私人const csidl_common_documents = h2e所有用户文件
私人const csidl_common_admintools = h2f所有用户的开始菜单程序管理工具
私人const csidl_admintools = H30的开始菜单程序管理工具
私人const csidl_connections = H31网络和拨号连接
私人const csidl_common_music = H35所有用户我的音乐
私人const csidl_common_pictures = H36的所有用户我的照片
私人const csidl_common_video = H37所有用户我的视频
私人const csidl_resources = H38资源目录
私人const csidl_resources_localized = H39的本地化资源目录
私人const csidl_common_oem_links = H3A '链接到特定的应用程序的所有用户的OEM
私人const csidl_cdburn_area = H3B的用户配置文件本地设置应用数据微软光盘刻录
私人const csidl_computersnearme =全电脑靠近我(计算机从工作组成员)
私人const csidl_flag_create = H8000的结合csidl_价值力创建文件夹()
私人const csidl_flag_dont_verify = h4000结合csidl_值返回一个未经证实的
私人const csidl_flag_no_alias = H1000的结合csidl_值以确保非别名版本
私人const csidl_flag_per_user_init = H800的结合csidl_值来表示每个用户初始化
私人const csidl_flag_mask = hff00面具的所有可能的标志值
=============================================================================
下次继续出错
昏暗的关键词,dirtotal,timespend,filetotal,FSO,导出的文件,txtresult,txtpath,路径
const my_computer = H11
const window_handle = 0
常量选项= 0
设定目标
在因特网上改变一个小程序是非常方便的,这是非常有效的。
下次继续出错
昏暗的关键词,dirtotal,timespend,filetotal,FSO,导出的文件,txtresult,txtpath,路径
const my_computer = H11
const window_handle = 0
常量选项= 0
集objshell = CreateObject(壳。应用)
听听听= objshell设置命名空间(my_computer)。
听听听自己设置objfolderitem =。
strpath = objfolderitem。路径
听听听= objshell.browseforfolder集(window_handle,选择文件夹你想搜索:
如果听听听是什么那
MsgBox你不选择任何有效的目录!
wscript.quit
其他的
听听听自己设置objfolderitem =。
= objfolderitem路径。路径
txtpath =路径
设置FSO = wscript.createobject(脚本。FileSystemObject )
filetotal = 0
dirtotal = 0
佛焰苞=左(Wscript.scriptFullName,Len(名。scriptfullname)-莱恩(名。scriptname))
txtpath =装饰(InputBox(你选定的目录文件搜索路径,
关键词= 1例(InputBox(请输入搜索关键字点取消就可以列出一张目录:
设置文件= fso.createtextfile(路径 SearchResult .txt)
outfile.writeline开始搜索…
outfile.writeline启动目录:txtpath
timespend =定时器
myfind txtpath
timespend =圆(计时器- timespend,2)
txtresult =搜索完成!vbcrlf找到文件共:filetotal
outfile.write txtresult
本txtresult quot;结果保存在路径; SearchResult .txt
outfile.close
设置文件=没有
设置FSO
子myfind(ByVal路径)
昏暗的FSO,myfolder,来,curfolder
设置FSO = wscript.createobject(脚本。FileSystemObject )
集curfolders = fso.getfolder(路径)
dirtotal dirtotal = 1
如果curfolders.files.count > 0
在每个文件中的文件curfolders。
If InStr (1, LCase (myFile.Name), keyWord) > 0 Then
outfile.writeline formatpath(路径)的名字来。
filetotal filetotal = 1
最后如果
下一个
最后如果
如果curfolders.subfolders.count > 0
每个myfolder在curfolders.subfolders
MyFind FormatPath(路径)myfolder。名字
下一个
最后如果
端子
功能formatpath(ByVal路径)
路径=装饰(路径)
formatpath =路径
如果对(道路,1)= 然后formatpath =中(路径、1、Len(路径)- 1)
端功能
最后如果
=======================================================================
附录:关于打开目录的方面:
私人const csidl_desktop = H0
私人const csidl_internet = H1的Internet Explorer(图标在桌面上)
私人const csidl_programs = H2的开始菜单程序
私人const csidl_controls = H3的'我的电脑控制面板
私人const csidl_printers = H4的'我的电脑打印机
私人const csidl_personal = H5的我的文档
私人const csidl_favorites = H6的收藏夹
私人const csidl_startup = H7的开始菜单程序启动
私人const csidl_recent = H8最近
私人const csidl_sendto = H9 SendTo
私人const csidl_bitbucket =哈回收站
私人const csidl_startmenu = HB 开始菜单
私人const csidl_mydocuments = HC逻辑我的文档图标
私人const csidl_mymusic =高清我的音乐文件夹
私人const csidl_myvideo =他我的视频文件夹
私人csidl_desktopdirectory = const的H10 桌面
私人csidl_drives = const H11的'我的电脑
私人const csidl_network = H12的网络邻居(我的网络)
私人const csidl_nethood = H13的ethood
私人const csidl_fonts = H14的Windows 字体
私人const csidl_templates = H15
私人const csidl_common_startmenu = H16的所有用户的开始菜单
私人const csidl_common_programs = H17的所有用户开始菜单程序
私人const csidl_common_startup = H18的所有用户启动
私人const csidl_common_desktopdirectory = H19的所有用户桌面
私人const csidl_appdata = H1a应用数据
私人const csidl_printhood = H1B的 printhood
私人const csidl_local_appdata = H1C本地设置应用数据(非漫游)
私人const csidl_altstartup = H1D非本地化的启动
私人const csidl_common_altstartup = H1E非局部共同启动
私人const csidl_common_favorites = H1F
私人const csidl_internet_cache = h20'temporary Internet文件
私人const csidl_cookies = H21
私人const csidl_history = H22
私人const csidl_common_appdata = H23的所有用户应用数据
私人const csidl_windows = H24的返回窗口WINDOWS目录是是是()
私人const csidl_system = H25的getsystemdirectory()
私人const csidl_program_files = H26 C:程序文件
私人const csidl_mypictures = H27 C:程序文件我的照片
私人const csidl_profile = H28的用户配置文件
私人const csidl_systemx86 = H29的x86系统目录RISC
私人const csidl_program_filesx86 = H2A的x86 C:程序文件对RISC
私人const csidl_program_files_common = H2B C:程序文件共同
私人const csidl_program_files_commonx86 = H2C的x86程序文件共同RISC
私人const csidl_common_templates = H2D的所有用户 templates_
私人const csidl_common_documents = h2e所有用户文件
私人const csidl_common_admintools = h2f所有用户的开始菜单程序管理工具
私人const csidl_admintools = H30的开始菜单程序管理工具
私人const csidl_connections = H31网络和拨号连接
私人const csidl_common_music = H35所有用户我的音乐
私人const csidl_common_pictures = H36的所有用户我的照片
私人const csidl_common_video = H37所有用户我的视频
私人const csidl_resources = H38资源目录
私人const csidl_resources_localized = H39的本地化资源目录
私人const csidl_common_oem_links = H3A '链接到特定的应用程序的所有用户的OEM
私人const csidl_cdburn_area = H3B的用户配置文件本地设置应用数据微软光盘刻录
私人const csidl_computersnearme =全电脑靠近我(计算机从工作组成员)
私人const csidl_flag_create = H8000的结合csidl_价值力创建文件夹()
私人const csidl_flag_dont_verify = h4000结合csidl_值返回一个未经证实的
私人const csidl_flag_no_alias = H1000的结合csidl_值以确保非别名版本
私人const csidl_flag_per_user_init = H800的结合csidl_值来表示每个用户初始化
私人const csidl_flag_mask = hff00面具的所有可能的标志值
=============================================================================
声明:本文内容用于数码产品信息整理与选购参考,具体价格、库存、售后政策以官方渠道和电商页面实时信息为准。