Created
July 15, 2013 06:52
-
-
Save grayatrox/5997933 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
results := search("notepad","C:\Windows") ; This is something I know everyone will have | |
for result in results | |
msgbox Result: %result% | |
Return | |
search(searchTerm, searchDirectory = "C:", filePattern = "*.*", recursive = 1) { | |
results := {} | |
SplitPath, searchTerm , OutFileName, OutDir, OutExtension, OutNameNoExt, OutDrive | |
if (!OutExtension) | |
{ | |
search := searchDirectory "\" filePattern | |
} Else { | |
search := searchDirectory | |
} | |
Progress, R0-100 H125 y10,,Searching... | |
progress := 0 | |
Loop, %search%, 0, %recursive% | |
{ | |
progress += 0.1 | |
Progress, %progress%, %A_LoopFileName%, Searching: %searchDirecory%, Current File: | |
If (InStr(A_LoopFileName,searchTerm)) | |
{ | |
results.Insert(A_LoopFileFullPath) | |
} | |
if (progress > 100) | |
progress := 0 | |
} | |
return, results | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment