How to Find Files Fast Using DOS and Notepad

Do you have a large hard drive? Mine isn’t very big, but I’ve still got over 90,000 files on it.

When I use Windows built in search tool to search for files, it seems to take ages for it to even start looking. It’s almost like the search tool wakes from a deep sleep and decides to start work after a cup of coffee. I can’t blame it, I feel the same way most mornings.


The solution I’ve come up with works for me and maybe it’ll work for you as well. It doesn’t require any tools that aren’t already on your Windows machine.

I wanted to search a network drive with over 600,000 files on it. Windows searches were taking up to half an hour to produce results. I was prepared to take a lunch break when I initiated a search.

I decided to fall back on my rusty old skills as a DOS batch file guru.

I wrote up a single line of text in Notepad with the following command on it where M: was the network drive I wanted to search.

DIR /B /S M:\*.* > C:\M_file_list.txt


Then I saved the file as a .BAT file in a handy location.

Double clicking the BAT file launched it. When I launch a batch file, it helps if I stand and pronounce this chant in a loud voice with both hands raised over the PC.

By the Power of DOS, I command you!

That really works best in a quiet room full of people who have no clue what I’m doing.

Fifteen minutes later, I had a text list that included the full path of all 600,000 files on the M: drive.


Now whenever I need to find a file, I open up the M_file_list text file and hit F3 or CTRL+F to open up the text search dialog.

Searching the text file is hundreds of times faster than Windows standard search was taking. The search takes around   5 or 10 seconds instead of half an hour. That does cut into my long lunch breaks, but we all have to sacrifice things in these hard times.



When I find the file I want, I copy the file path and paste it into the Start -> Run menu, to open the folder or the file itself.


Happy searching!

You can leave out the chanting if you have to.

Published by

Clif Sipe

Promoting Freeware and Free information since 2004. Owner of with over 2000 pages of freebies. Please subscribe to my Google Feed or follow me on Twitter @clifnotes.

  • Honestly, I’ve over 150,000 files stored in my hard drive and it’s a painfully task to browse through it! Maybe this little trick is going to help me eliminate the hassle away. Thanks again, Clif.

  • Sriram

    Ultimate work. Thanks for the post.


  • Thanks for the comment Wilson. I hope it does help you. If it doesn’t there are a few other tricks that I’m sure I and others here can recommend.

  • Thanks for this tip, I always like the MSDOS tags :)

  • Great job Clif

    • Thanks Soumen, I appreciate the comment.

  • Hey Clif~

    Stumbled upon this post and thought it was just great.
    Got bored and wrote a 30 min AutoHotKey script that will parse through the file you created and allow you to search within the lines in a listview GUI. In other words if you search for “ins” you will get all the lines displayed that have “ins” in them. Then you can right click and choose to run that line or copy it to the clipboard. I know there is Everything by VoidTools which is so much better, but like I said, I got bored. :)


    Here is the script:

    SetBatchLines, -1

    Width := 600
    Height := 600
    ;I have made the menu expandable. Just add the new commands you want delimited by `n with no spaces then create a new label with that name :)
    Menu_Items = Run_Line`nCopy_Line

    Loop, Parse, Menu_Items, `n
    Menu, CTX, Add, %A_LoopField%, OnMenu

    Gui, Add, Edit, vUser_Query w600
    Gui, Add, Button, gSearch, Search
    Gui, Add, ListView, w600 h600 vLV_Content gOn_LVEvent AltSubmit, File Lines
    Gui, Show, , Quick Find
    FileSelectFile, Loaded_File
    FileRead, File_Content, %Loaded_File%
    SplashTextOn, 200, 200, Parsing File, `nPlease wait a moment`n`nIf the file is big it could take a minute or two
    Gui, +Disabled
    Gui, -Disabled


    Goto, %A_ThisMenuItem%

    Line_Text =
    if (A_GuiEvent = “RightClick”)
    MouseGetPos, X, Y
    LV_GetText(Line_Text, A_EventInfo)
    Menu, CTX, Show, %X%, %Y%

    StringReplace, Line_Text, Line_Text, `n, , All
    StringReplace, Line_Text, Line_Text, `r, , All
    Run, %Line_Text%

    StringReplace, Line_Text, Line_Text, `n, , All
    StringReplace, Line_Text, Line_Text, `r, , All
    Clipboard = %Line_Text%
    TrayTip, Copied!, %Line_Text%
    SetTimer, Tray_Off, -4000


    Gui, +Disabled
    SplashTextOn, 200, 200, Parsing File, `nPlease wait a moment`n`nIf the file is big it could take a minute or two
    GuiControlGet, Query, , User_Query
    if (Query = “”)
    search_list := File_Content


    Loop,parse, File_Content,`n,%A_Space%%A_Tab%
    Current_Line := A_LoopField
    tcount =
    tfound =
    loop, parse, Query, %A_Space%,%A_Tab%
    if (A_LoopField = “”)
    if instr( Current_Line, A_LoopField )
    if (tcount == tfound)
    search_list .= Current_Line . “`n”
    Current_Line =
    search_list =
    Gui, -Disabled

    Build_List(list) {

    StringReplace, list, list, `r, , All
    Loop, parse, list, `n,%A_Space%%A_Tab%
    if (A_LoopField = “”)
    LV_Add(“”, A_LoopField)
    LV_ModifyCol(1, “AutoHdr”)

    • Hmmm Just realized the script lost all formatting and changed ” to some odd character. Here I just uploaded the file on the site so you can copy it properly:

      • Hi John-Paul – nice idea. Can you compile it and put it out as an EXE file for us to look at? I don’t keep AHK installed. I’ve used it, but never for long.

  • Everything search engine.

    go to this link :

    it has many advantages :
    Small installation file.
    Clean and simple user interface.
    Quick file indexing.
    Quick searching
    Minimal resource usage.
    Share files with others easily.
    Real-time updating