Helpful Batch File Search





Introduction: Helpful Batch File Search

This is my first instructable. so if I made a mistake please go easy on me.

I had made a simple batch file searcher, to help my self finding the files I need in my HDD jungle.
This batch is so much faster than standard windows search(windows button +f).

- Very fast
- easy to make.
- Portable (infact you can memorize all the commands)
- using it makes you look very cool. :D

- Limited to file name search only.
- must update data base regularly.
- update might took forever :)

I've searched instructable for similar batch file but found none.
That encourage me to make one.

Step 1: Getting Prepared

1. run cmd on Start->run, type in cmd, press enter.
2. create a new folder. (md anything)
3. add the new folder to your system path variable
control panel->system properties->advanced->environment variable->select path->edit->ok
4. check it on the command window by typing "path" followed by enter button.
5. explore to your new folder.
6. create two new text document.
7. rename one of them into update.
8. rename the other one into search.

Step 2: First Batch File

this is the content of the update.txt file
just copy and paste it into the update.txt

@title UPDATE
@del k:\finder\allfiles.log
@dir c:\ d:\ e:\ f:\ G:\ h:\ I:\ J:\ K:\ /s /a /b >> K:\finder\Allfiles.log

please edit the folder "K:\finder" into the folder name you just made.

save it

note :
you can add or remove the drive letter to suit your system.
the command above will be indexing file name from drive letter C to K.

Step 3: Second Batch File

This is the content of the second file
search .txt
just copy paste it.
@echo off
Title Search
echo use \.extension $ for seeking extenson of file ie:*.mp3
color 0a
findstr /I /L /A:FC "%1 %2 %3" k:\finder\allfiles.log |more

please edit the folder "K:\finder" into the folder name you just made.
save it.

Step 4: Rename the Text Document

go to your command prompt
ren *.txt *.bat
press enter
you should get 2 new batch file now instead of text document.

Step 5: Creating the Logs

now run the update.bat
and wait for..........quite some time.
relax it might took 5 to 15 minutes to finish.

after it got finished it will create new file called
a huge one :)

Step 6: Action

then you can run the search.bat file.
sample of usage

search update
search \.doc (for searching file extension)

more control:
press enter to get one line scrolling.
press space bar to get page scrolling.
press ctrl+c to quit searching.

since it already on your system path you can ran both search and update from any folder,
or even from the run command.

actually if you are an advanced user you can skip few step of this instructible.
hope it will became handy for you as it did for me.
thank you for reading.



    • Pocket-Sized Contest

      Pocket-Sized Contest
    • Science of Cooking

      Science of Cooking
    • Pro Tips Challenge

      Pro Tips Challenge

    We have a be nice policy.
    Please be positive and constructive.




    I want to make Batch file able to make and write to .txt files, then everytime I start it it searches for .txt files in the folder it is. How?

    This is really complicated. Maybe you could post a downloadable version of it...

    No wonder any of these work! They contain wrong Command Sets!!!

    I'm terribly sorry, but the grammar and spelling in this instructable was just terrible. I honestly couldn't understand a thing. Better luck next time.

     thank you, English is my second language. I think i did the best :(

    Oh, sorry! I didn't know. I didn't mean it like that, I though you were doing it on purpose! I thought you were purposely trying to make it like that, but I understand now. Oh, I'm really sorry! Please understand!

    :) no worries...
    You're not the only one and I did get that a lot...  so I get used to it... XD.  

    i know this is an older instructable but i was wondering if i could still get any help. I am trying to perform a search on my computer but instead of searching in a list of the file names, i want to find files on my computer that match the files names i give it, preferably line by line in a text file, example: file1.txt file5.exe lots_of_junk.html i can give this in a text file and have one file on every line of the text. next (which is where my problem is) is i need the computer to find the files that have the same name of the files given and copy, delete, or move them. the end result should be able to find the file anywhere on the system even if the file is hidden. If i need to elaborate on anything let me know, thx for the help