Jump to content

Search For Files And Folders


 Share

Recommended Posts

I made this script because I wanted a quicker way to search for files:

A replacement for Windows File Search.

If you start the script, it will ask you what you want and which words/characters to search for.

You can search for all keywords using spaces between the words;

Example:

elton john .mp3

That will match all mp3 files with elton john in the filename or path.

You can search for any (or some) keywords using the first word as 'any';

Example:

any james .doc

It will find any files that contain either james OR have the extension .doc OR both.

You can search for files with the method OR. using the character "|";

Example:

.mp3|.wav|.wma

That will match all files that are .mp3 OR .wav OR .wma.

After that you can choose in which drive/folder to search for.

If there are no matches you will be shown and it will be written in results.txt

Features:

  • last search is saved, on startup it will be filled in the inputbox.
  • a progressbar when it's searching
  • locate the file automatically by answering a dialog if you want to

    (see beginning of the script)

  • You can automatically create a batch file that moves the files to

    a folder you specify at startup

Known issues:
  • none
Here it is, enjoy:

...http://neoangelo.3x.ro/scripts/Search.au3...

(copy/paste above link in a new browser page)

Edited by SlimShady
Link to comment
Share on other sites

If you want to search for a part, enter just the part; example:

Elton .mp3

It will match all Elton John mp3s example. So you wouldn't have to enter Elton John .mp3

I'm now creating

- the ability to exclude words: Easy.

- the ability to search using the OR operator. That will be the "|" character.

Example: "elton john |.mp3|.wav|.wma"

- some extra functions (any ideas?): MoveAllMatches. You will get the ability to choose a folder to move the matches to.

I'm gonna start working on the new features right now.

Edited by SlimShady
Link to comment
Share on other sites

I've got a problem. My For... doesn't work anymore.

I replaced the For... with While...WEnd.

It says:

Error: "Wend" statement with no matching "While" statement

The same thing with For....

(Problem solved.)

Edited by SlimShady
Link to comment
Share on other sites

  • Developers

just processed your script with Tidy and you can easely see that you are missing an endif........this is the output:

Func SearchAND($READLINE)
   $FOUNDNUM = 0
   
  ;======Start MultiWords
   If $MULTIWORDS = "Yes" Then
      
    ;=====Start searching each word
      $NUM = 1
      
      While $I <= $WORDS[0]
        ;=====Check match
         $FOUND = StringInStr($READLINE, $WORDS[$NUM])
         
         If $IGNORE[0] > 0 Then
            $NUM = $IGNORE[0] + 1
            
            $IGNORE[$NUM] = StringInStr($READLINE, "Temporary Internet Files")
            
            $EXC = 1
            Do
               $IGNORE = StringInStr($READLINE, $IGNORE[$EXC])
              ;=======Ignore certain words
               If $IGNORE > 0 Then $FOUND = 0
               $EXC = $EXC + 1
            Until $EXC = $IGNORE[0]
            
            If $FOUND > 0 Then
               $FOUNDNUM = $FOUNDNUM + 1
            EndIf
            
          ;========End searching for words
            $I = $I + 1
         Wend
         
         If $FOUNDNUM = $WORDS[0] Then
            $FOUND = 1
            $FOUNDSOMETHING = "yes"
         Else
            $FOUND = 0
         EndIf
         
        ;=======If not MultiWords.........
      Else
         
        ;=====Check match
         $FOUND = StringInStr($READLINE, $WORDS)
         
         $IGNORE = StringInStr($READLINE, "Temporary Internet Files")
         
         If $IGNORE > 0 Then $FOUND = 0
         
      EndIf
   EndFunc  ;==>SearchAND
Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

* I cleaned the script using AutoIt Tidy

* Lot's of bugfixes

* I tried to create the exclude feature but I just can't get it work, so I deleted it. I will recreate it when I'm thinking clear.

* I'll work on this when I get home (an hour from now)

Link to comment
Share on other sites

Added full functionality to search for any keyword.

So you can enter some keywords, if it matches one, it saves the line.

If it matches multiple keywords in one line, it saves the line too.

I can't get the exclude thing to work. I'm stuck.

I get an error; I tried anything, but no luck. It's still in the script.

See first post.

Link to comment
Share on other sites

  • 3 weeks later...

Seems you have meet your upload limit on lycos...care to just code it in here?

Too much traffic...

I've uploaded it to another place:

...http://neoangelo.3x.ro/scripts/Search.au3...

Copy/paste in a new browser page to download it.

Link to comment
Share on other sites

  • 3 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...