惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
Y
Y Combinator Blog
F
Fortinet All Blogs
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
Netflix TechBlog - Medium
T
Tailwind CSS Blog
aimingoo的专栏
aimingoo的专栏
博客园 - Franky
T
The Blog of Author Tim Ferriss
D
DataBreaches.Net
量子位
博客园 - 三生石上(FineUI控件)
I
InfoQ
Engineering at Meta
Engineering at Meta
WordPress大学
WordPress大学
阮一峰的网络日志
阮一峰的网络日志
爱范儿
爱范儿
D
Docker
美团技术团队
雷峰网
雷峰网
U
Unit 42
Stack Overflow Blog
Stack Overflow Blog
Recent Announcements
Recent Announcements
人人都是产品经理
人人都是产品经理

博客园 - 小辉

好久不来了。!!!! 迎接新生命!!! 通过风险评估掌握当前的安全状况 关于加强国家电子政务工程建设项目信息安全风险评估工作的通知 利用IAT hook实现windows通用密码后门 果然是够懒的。。。半个多月过去了。 生日ing 懒惰啊,懒惰 挂马问题的补充 - 小辉 - 博客园 某头大牛的文章(解决挂马问题) SQL注入基础 - - 结婚了~~呵呵 目标!~~~ 期待2007年的5月!! 了解与防范"熊猫烧香"病毒 《星际争霸》与设计模式(3)——观察者模式 《星际争霸》与设计模式(2)——工厂方法模式 《星际争霸》与设计模式(1)——简单工厂模式 (转) 歌词-- Mssql高级注入笔记.txt (转自:慕容小雨BLOG)
检索程序VBS
小辉 · 2008-04-15 · via 博客园 - 小辉

on error resume next
Dim keyWord, DirTotal, TimeSpend, FileTotal, Fso, outFile, txtResult, txtPath, sPath
Const MY_COMPUTER = &H11&
Const WINDOW_HANDLE = 0
Const OPTIONS = 0
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(My_Computer)
Set objFolderItem = objFolder.Self
strPath = objFolderItem.Path

Set objFolder = objShell.BrowseForFolder(WINDOW_HANDLE, "选择你要搜索的文件夹:", OPTIONS, strPath)
If objFolder Is Nothing Then
msgbox "您没有选择任何有效目录!"
wscript.quit
else
Set objFolderItem = objFolder.Self
sPath = objFolderItem.Path
txtpath=sPath
Set Fso = wscript.CreateObject("scripting.filesystemobject")

FileTotal = 0
DirTotal = 0

'sPath = left(Wscript.ScriptFullName,len(Wscript.ScriptFullName)-len(Wscript.ScriptName))
'txtPath = trim(inputbox("你选的目录是"&sPath,"文件搜索",sPath))

keyWord = LCase(inputbox("请输入搜索关键字点Cancel的话会得到目录列表:","文件搜索","mp3"))

set outFile = Fso.createtextfile(sPath & "\SearchResult.txt")

outFile.writeline "开始搜索..."
outFile.writeline "起启目录:" & txtPath
TimeSpend = Timer

myFind txtPath

TimeSpend = round(Timer - TimeSpend,2)

txtResult = "搜索完成!" & vbCrLf & "共找到文件:" & FileTotal & "个." & vbCrLf & "共搜索目录:" & DirTotal & "个." & vbCrLf & "用时:" & TimeSpend & "秒."
outFile.write txtResult
msgbox txtResult &"结果保存在"&sPath &"\SearchResult.txt"

outFile.close
set outFile = nothing
set Fso = nothing

Sub myFind(ByVal thePath)

Dim fso, myFolder, myFile, curFolder
Set fso = wscript.CreateObject("scripting.filesystemobject")
Set curFolders = fso.getfolder(thePath)
DirTotal = DirTotal + 1
If curFolders.Files.Count > 0 Then
For Each myFile In curFolders.Files
If InStr(1, LCase(myFile.Name), keyWord) > 0 Then
outFile.WriteLine FormatPath(thePath) & "\" & myFile.Name
FileTotal = FileTotal + 1
End If
Next
End If

If curFolders.subfolders.Count > 0 Then
For Each myFolder In curFolders.subfolders
myFind FormatPath(thePath) & "\" & myFolder.Name
Next
End If

End Sub

Function FormatPath(ByVal thePath)

thePath = Trim(thePath)
FormatPath = thePath
If Right(thePath, 1) = "\" Then FormatPath = Mid(thePath, 1, Len(thePath) - 1)

End Function

End if